[poppler] poppler/Gfx.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Jan 8 22:49:34 UTC 2018
poppler/Gfx.cc | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
New commits:
commit cbd864b74fe368c1172974c7040c67ddfbc52cf6
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Jan 8 23:48:57 2018 +0100
Fix abort in Gfx::opBeginMarkedContent if args[1] is not a name
Bug #104468
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index ee8f3193..60fc98cc 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -5025,18 +5025,19 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
char* name0 = args[0].getName();
if ( strncmp( name0, "OC", 2) == 0 && contentConfig) {
if ( numArgs >= 2 ) {
- if (!args[1].isName()) {
- error(errSyntaxError, getPos(), "Unexpected MC Type: {0:d}", args[1].getType());
- }
- char* name1 = args[1].getName();
- MarkedContentStack *mc = mcStack;
- mc->kind = gfxMCOptionalContent;
- Object markedContent = res->lookupMarkedContentNF( name1 );
- if (!markedContent.isNull()) {
- bool visible = contentConfig->optContentIsVisible(&markedContent);
- mc->ocSuppressed = !(visible);
+ if (args[1].isName()) {
+ char* name1 = args[1].getName();
+ MarkedContentStack *mc = mcStack;
+ mc->kind = gfxMCOptionalContent;
+ Object markedContent = res->lookupMarkedContentNF( name1 );
+ if (!markedContent.isNull()) {
+ bool visible = contentConfig->optContentIsVisible(&markedContent);
+ mc->ocSuppressed = !(visible);
+ } else {
+ error(errSyntaxError, getPos(), "DID NOT find {0:s}", name1);
+ }
} else {
- error(errSyntaxError, getPos(), "DID NOT find {0:s}", name1);
+ error(errSyntaxError, getPos(), "Unexpected MC Type: {0:d}", args[1].getType());
}
} else {
error(errSyntaxError, getPos(), "insufficient arguments for Marked Content");
More information about the poppler
mailing list