Bug#484224: Continued

Antoine Cailliau a.cailliau at ac-graphic.net
Thu Jun 12 14:15:35 UTC 2008


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

obviously solved. But it is more a workaround than a fix.
-------------- next part --------------
--- ./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;


More information about the pkg-gnome-maintainers mailing list