Skip to content

Commit

Permalink
[Minor] Pdf: Add some sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jun 5, 2020
1 parent a0abf27 commit 1a5d3a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lualib/lua_content/pdf.lua
Expand Up @@ -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)
Expand Down

0 comments on commit 1a5d3a2

Please sign in to comment.