From 1a5d3a27d7fffd575816d6efa6965c5702bf4171 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 5 Jun 2020 20:16:15 +0100 Subject: [PATCH] [Minor] Pdf: Add some sanity check --- lualib/lua_content/pdf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib/lua_content/pdf.lua b/lualib/lua_content/pdf.lua index 5e1fa9061..ed88a24bd 100644 --- a/lualib/lua_content/pdf.lua +++ b/lualib/lua_content/pdf.lua @@ -426,7 +426,7 @@ local function maybe_extract_object_stream(obj, pdf, task) return nil end local dict = obj.dict - if dict.Length then + if dict.Length and type(obj.stream) == 'table' then local len = math.min(obj.stream.len, tonumber(maybe_dereference_object(dict.Length, pdf, task)) or 0) local real_stream = obj.stream.data:span(1, len) -- 2.39.5