[poppler] poppler/OptionalContent.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Sep 17 22:10:12 UTC 2018
poppler/OptionalContent.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 94527d5a61eb3402b49436b978bad69f71884051
Author: Adam Reichold <adam.reichold at t-online.de>
Date: Sat Sep 15 09:31:37 2018 +0200
Check for Ref type before unwrapping Object as such
oss-fuzz/10359
diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc
index 8376a0e4..3f0ef264 100644
--- a/poppler/OptionalContent.cc
+++ b/poppler/OptionalContent.cc
@@ -7,6 +7,7 @@
// Copyright 2008, 2010 Carlos Garcia Campos <carlosgc at gnome.org>
// Copyright 2008, 2010, 2011, 2017, 2018 Albert Astals Cid <aacid at kde.org>
// Copyright 2008 Mark Kaplan <mkaplan at finjan.com>
+// Copyright 2018 Adam Reichold <adam.reichold at t-online.de>
//
// Released under the GPL (version 2, or later, at your option)
//
@@ -22,7 +23,6 @@
#include "goo/GooString.h"
#include "goo/GooList.h"
#include "Error.h"
-// #include "PDFDocEncoding.h"
#include "OptionalContent.h"
// Max depth of nested visibility expressions. This is used to catch
@@ -184,7 +184,6 @@ bool OCGs::optContentIsVisible( Object *dictRef )
return result;
}
dict = dictObj.getDict();
- // printf("checking if optContent is visible\n");
Object dictType = dict->lookup("Type");
if (dictType.isName("OCMD")) {
Object ve = dict->lookup("VE");
@@ -213,13 +212,12 @@ bool OCGs::optContentIsVisible( Object *dictRef )
}
}
}
- } else if ( dictType.isName("OCG") ) {
+ } else if ( dictType.isName("OCG") && dictRef->isRef() ) {
OptionalContentGroup* oc = findOcgByRef( dictRef->getRef() );
if ( oc && oc->getState() == OptionalContentGroup::Off ) {
result=false;
}
}
- // printf("visibility: %s\n", result? "on" : "off");
return result;
}
More information about the poppler
mailing list