If I comment test optionalContentGroups against null values, the bug is

obviously solved. But it is more a workaround than a fix.
--- ./poppler-0.8.2/poppler/OptionalContent.cc  2008-03-26 20:38:52.000000000 
+0100
+++ ./fpoppler-0.8.2/poppler/OptionalContent.cc 2008-06-12 16:13:20.000000000 
+0200
@@ -162,11 +162,16 @@
 {
   //TODO: make this more efficient
   OptionalContentGroup *ocg = NULL;
-  for (int i=0; i < optionalContentGroups->getLength(); ++i) {
-    ocg = (OptionalContentGroup*)optionalContentGroups->get(i);
-    if ( (ocg->ref().num == ref.num) && (ocg->ref().gen == ref.gen) ) {
-      return ocg;
-    }
+  
+  //FIXME: Cause segfault
+  if(!(optionalContentGroups == NULL)) {
+         int length = optionalContentGroups->getLength();
+         for (int i=0; i < length; ++i) {
+               ocg = (OptionalContentGroup*)optionalContentGroups->get(i);
+               if ( (ocg->ref().num == ref.num) && (ocg->ref().gen == ref.gen) 
) {
+                 return ocg;
+               }
+         }
   }
   // not found
   return NULL;

Reply via email to