rpms/poppler/devel poppler-0.8.0-ocg-crash.patch, NONE, 1.1 poppler.spec, 1.69, 1.70

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Sun Apr 6 23:05:21 UTC 2008


Author: ajax

Update of /cvs/pkgs/rpms/poppler/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10936

Modified Files:
	poppler.spec 
Added Files:
	poppler-0.8.0-ocg-crash.patch 
Log Message:
* Sun Apr 06 2008 Adam Jackson <ajax at redhat.com> 0.8.0-3
- poppler-0.8.0-ocg-crash.patch: Fix a crash when no optional content
  groups are defined.
- Mangle configure to account for the new directory for qt3 libs.
- Fix grammar in %description.


poppler-0.8.0-ocg-crash.patch:

--- NEW FILE poppler-0.8.0-ocg-crash.patch ---
diff -up poppler-0.8.0/poppler-0.8.0/poppler/OptionalContent.cc.jx poppler-0.8.0/poppler-0.8.0/poppler/OptionalContent.cc
--- poppler-0.8.0/poppler-0.8.0/poppler/OptionalContent.cc.jx	2008-03-14 20:24:54.000000000 -0400
+++ poppler-0.8.0/poppler-0.8.0/poppler/OptionalContent.cc	2008-04-06 18:56:06.000000000 -0400
@@ -162,6 +162,8 @@ OptionalContentGroup* OCGs::findOcgByRef
 {
   //TODO: make this more efficient
   OptionalContentGroup *ocg = NULL;
+  if (!optionalContentGroups)
+    return 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) ) {
@@ -208,7 +210,7 @@ bool OCGs::optContentIsVisible( Object *
       }
     } else if (ocg.isRef()) {
       OptionalContentGroup* oc = findOcgByRef( ocg.getRef() );      
-      if ( oc->state() == OptionalContentGroup::Off ) {
+      if ( !oc || oc->state() == OptionalContentGroup::Off ) {
 	result = false;
       } else {
 	result = true ;
@@ -218,11 +220,8 @@ bool OCGs::optContentIsVisible( Object *
     policy.free();
   } else if ( dictType.isName("OCG") ) {
     OptionalContentGroup* oc = findOcgByRef( dictRef->getRef() );
-    if ( oc ) {
-//       printf("Found valid group object\n");
-      if ( oc->state() == OptionalContentGroup::Off ) {
-	result=false;
-      }
+    if ( !oc || oc->state() == OptionalContentGroup::Off ) {
+      result=false;
     }
   } 
   dictType.free();
@@ -253,6 +252,8 @@ bool OCGs::allOff( Array *ocgArray )
     ocgArray->getNF(i, &ocgItem);
     if (ocgItem.isRef()) {
       OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() );      
+      if (!oc)
+	  continue;
       if ( oc->state() == OptionalContentGroup::On ) {
 	return false;
       }
@@ -268,6 +269,8 @@ bool OCGs::anyOn( Array *ocgArray )
     ocgArray->getNF(i, &ocgItem);
     if (ocgItem.isRef()) {
       OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() );      
+      if (!oc)
+	  continue;
       if ( oc->state() == OptionalContentGroup::On ) {
 	return true;
       }
@@ -283,6 +286,8 @@ bool OCGs::anyOff( Array *ocgArray )
     ocgArray->getNF(i, &ocgItem);
     if (ocgItem.isRef()) {
       OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() );      
+      if (!oc)
+	  continue;
       if ( oc->state() == OptionalContentGroup::Off ) {
 	return true;
       }


Index: poppler.spec
===================================================================
RCS file: /cvs/pkgs/rpms/poppler/devel/poppler.spec,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- poppler.spec	1 Apr 2008 20:50:19 -0000	1.69
+++ poppler.spec	6 Apr 2008 23:04:38 -0000	1.70
@@ -3,7 +3,7 @@
 Summary: PDF rendering library
 Name: poppler
 Version: 0.8.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2 and Redistributable, no modification permitted
 # the code is GPLv2
 # the charmap data in /usr/share/poppler is redistributable
@@ -13,6 +13,7 @@
 Source1: http://poppler.freedesktop.org/poppler-data-%{dataversion}.tar.gz
 Patch0: poppler-ObjStream.patch
 Patch1: fix-qt4-build.patch
+Patch2: poppler-0.8.0-ocg-crash.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
 BuildRequires: gtk2-devel
@@ -21,7 +22,7 @@
 BuildRequires: qt4-devel
 
 %description
-Poppler, a PDF rendering library, it's a fork of the xpdf PDF
+Poppler, a PDF rendering library, is a fork of the xpdf PDF
 viewer developed by Derek Noonburg of Glyph and Cog, LLC.
 
 %package devel
@@ -31,7 +32,7 @@
 Requires: pkgconfig
 
 %description devel
-Poppler, a PDF rendering library, it's a fork of the xpdf PDF
+Poppler, a PDF rendering library, is a fork of the xpdf PDF
 viewer developed by Derek Noonburg of Glyph and Cog, LLC.
 
 You should install the poppler-devel package if you would like to
@@ -103,7 +104,7 @@
 Obsoletes: xpdf-utils <= 1:3.01-26.fc7
 
 %description utils
-Poppler, a PDF rendering library, it's a fork of the xpdf PDF
+Poppler, a PDF rendering library, is a fork of the xpdf PDF
 viewer developed by Derek Noonburg of Glyph and Cog, LLC.
 
 This utils package installs a number of command line tools for
@@ -113,17 +114,20 @@
 %setup -c -q -a1
 %patch0 -p1 -b .objstream
 %patch1 -p1 -b .fix-qt4-build
+%patch2 -p1 -b .ocg
 
 %build
-( cd  %{name}-%{version}
+pushd %{name}-%{version}
+# despair
+sed -i s/qt3/qt-3.3/g configure
 %configure \
   --disable-static \
   --enable-cairo-output \
   --enable-poppler-qt \
   --enable-poppler-qt4 \
   --enable-xpdf-headers
-)
-make %{?_smp_mflags} -C %{name}-%{version}
+make %{?_smp_mflags}
+popd
 
 pushd poppler-data-%{dataversion}
 cp COPYING COPYING-poppler-data
@@ -197,6 +201,12 @@
 %{_mandir}/man1/*
 
 %changelog
+* Sun Apr 06 2008 Adam Jackson <ajax at redhat.com> 0.8.0-3
+- poppler-0.8.0-ocg-crash.patch: Fix a crash when no optional content
+  groups are defined.
+- Mangle configure to account for the new directory for qt3 libs.
+- Fix grammar in %%description.
+
 * Tue Apr 01 2008 Rex Dieter <rdieter at fedoraproject.org> - 0.8.0-2
 - -qt-devel: Requires: qt3-devel
 




More information about the scm-commits mailing list