lib/hexapdf/content/parser.rb in hexapdf-0.47.0 vs lib/hexapdf/content/parser.rb in hexapdf-1.0.0
- old
+ new
@@ -110,10 +110,12 @@
@ss.pos += 1
TOKEN_ARRAY_START
elsif byte == 93 # ]
@ss.pos += 1
TOKEN_ARRAY_END
- elsif byte == 123 || byte == 125 # { }
+ elsif byte == 41 # )
+ raise HexaPDF::MalformedPDFError.new("Delimiter ')' found at invalid position", pos: pos)
+ elsif byte == 123 || byte == 125 # { } )
Token.new(@ss.get_byte)
elsif byte == 37 # %
unless @ss.skip_until(/(?=[\r\n])/)
(@raise_on_eos ? (raise StopIteration) : (return NO_MORE_TOKENS))
end