lib/hexapdf/parser.rb in hexapdf-0.15.8 vs lib/hexapdf/parser.rb in hexapdf-0.15.9
- old
+ new
@@ -163,10 +163,10 @@
elsif object[:Length].kind_of?(Reference)
@document.deref(object[:Length]).value
else
0
end
- @tokenizer.pos = pos + length
+ @tokenizer.pos = pos + length rescue pos
tok = @tokenizer.next_token
unless tok.kind_of?(Tokenizer::Token) && tok == 'endstream'
maybe_raise("Invalid stream length, keyword endstream not found", pos: @tokenizer.pos)
@tokenizer.pos = pos