[poppler] poppler/OptionalContent.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Feb 13 00:16:35 UTC 2017


 poppler/OptionalContent.cc |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 8de4b3595a80d8880b842599cb25ab5fd5367689
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Feb 13 01:15:04 2017 +0100

    Fix assert on reading some OCGs
    
    Check the object is a ref before calling getRef
    
    Bug #99768

diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc
index e0d49bc..2c5e435 100644
--- a/poppler/OptionalContent.cc
+++ b/poppler/OptionalContent.cc
@@ -63,6 +63,10 @@ OCGs::OCGs(Object *ocgObject, XRef *xref) :
     OptionalContentGroup *thisOptionalContentGroup = new OptionalContentGroup(ocg.getDict());
     ocg.free();
     ocgList.arrayGetNF(i, &ocg);
+    if (!ocg.isRef()) {
+      ocg.free();
+      break;
+    }
     // TODO: we should create a lookup map from Ref to the OptionalContentGroup
     thisOptionalContentGroup->setRef( ocg.getRef() );
     ocg.free();


More information about the poppler mailing list