mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
LibPDF: Clear arguments of unknown operators
This is a follow-up to #26905: If an unknown operator had arguments, we used to not clear them, causing the next known operator to receive them. To test, call an unknown operator with a non-number arg, followed by `re`.
This commit is contained in:
1 parent
d8c9bc03bb
commit
3ef7fb18dc
2 files changed
+6
-2
No files matched your search
@@ -14,11 +14,14 @@ endobj
|
||||
endobj
|
||||
|
||||
4 0 obj
|
||||
<</Length 5>>
|
||||
<</Length 52>>
|
||||
stream
|
||||
q
|
||||
QQ
|
||||
|
||||
() anotherunknownopwithanarg
|
||||
0 0 100 100 re f
|
||||
|
||||
endstream
|
||||
endobj
|
||||
|
||||
@@ -33,5 +36,5 @@ xref
|
||||
trailer
|
||||
<</Size 5/Root 1 0 R>>
|
||||
startxref
|
||||
248
|
||||
296
|
||||
%%EOF
|
||||
@@ -602,6 +602,7 @@ PDFErrorOr<Vector<Operator>> Parser::parse_operators()
|
||||
// but we ignore them everywhere. All other engines seem to do that too, so some files depend on it.
|
||||
// (Usually accidentally, e.g. containing "QQ" instead of "Q Q" or similar.)
|
||||
dbgln("ignoring unknown operator \"{}\"", operator_string);
|
||||
operator_args.clear();
|
||||
continue;
|
||||
}
|
||||
auto operator_type = maybe_operator_type.release_value();
|
||||
|
||||
Reference in new issue
Block a user