From 1e739df80d52a0655be3f6d5bc8640cdb53b5003 Mon Sep 17 00:00:00 2001 From: drochner Date: Thu, 15 May 2008 17:51:29 +0000 Subject: pull another patch from upstream CVS, to fix a possible crash, ride on today's PKGREVISION bump --- print/poppler/distinfo | 3 +- print/poppler/patches/patch-ai | 89 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 print/poppler/patches/patch-ai (limited to 'print') diff --git a/print/poppler/distinfo b/print/poppler/distinfo index e74a96ed42f..33d456a6ab6 100644 --- a/print/poppler/distinfo +++ b/print/poppler/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.27 2008/05/15 09:15:41 drochner Exp $ +$NetBSD: distinfo,v 1.28 2008/05/15 17:51:29 drochner Exp $ SHA1 (poppler-0.8.2.tar.gz) = afa4baa4e0b65c9663cddae7b0b3da8efb1c9263 RMD160 (poppler-0.8.2.tar.gz) = 6593f26070d051c6d5054acc454e15dde97a5203 @@ -7,3 +7,4 @@ SHA1 (patch-aa) = 43c63c16d3a845e394a8eb0c3a321944fcf17615 SHA1 (patch-ab) = e3d413ec50a098af06cb2efc2fac2042064498dd SHA1 (patch-ag) = d1581a1ca40bba34146a4a6f4ee7d38b8f6ff3b7 SHA1 (patch-ah) = ca50d0d8ef6da70f201cc66b0e797dde904b77e0 +SHA1 (patch-ai) = d03a8df1d32822a387f53206a21f8eba41a0c430 diff --git a/print/poppler/patches/patch-ai b/print/poppler/patches/patch-ai new file mode 100644 index 00000000000..a76d829ef64 --- /dev/null +++ b/print/poppler/patches/patch-ai @@ -0,0 +1,89 @@ +$NetBSD: patch-ai,v 1.3 2008/05/15 17:51:29 drochner Exp $ + +--- poppler/OptionalContent.cc.orig 2008-03-26 20:38:52.000000000 +0100 ++++ poppler/OptionalContent.cc +@@ -162,12 +162,18 @@ OptionalContentGroup* OCGs::findOcgByRef + { + //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; ++ if (optionalContentGroups != 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; ++ } + } + } ++ ++ error(-1, "Could not find a OCG with Ref (%d:%d)", ref.num, ref.gen); ++ + // not found + return NULL; + } +@@ -208,7 +214,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,13 +224,10 @@ 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(); + dictObj.free(); + // printf("visibility: %s\n", result? "on" : "off"); +@@ -238,7 +241,7 @@ bool OCGs::allOn( Array *ocgArray ) + ocgArray->getNF(i, &ocgItem); + if (ocgItem.isRef()) { + OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() ); +- if ( oc->state() == OptionalContentGroup::Off ) { ++ if ( oc && oc->state() == OptionalContentGroup::Off ) { + return false; + } + } +@@ -253,7 +256,7 @@ bool OCGs::allOff( Array *ocgArray ) + ocgArray->getNF(i, &ocgItem); + if (ocgItem.isRef()) { + OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() ); +- if ( oc->state() == OptionalContentGroup::On ) { ++ if ( oc && oc->state() == OptionalContentGroup::On ) { + return false; + } + } +@@ -268,7 +271,7 @@ bool OCGs::anyOn( Array *ocgArray ) + ocgArray->getNF(i, &ocgItem); + if (ocgItem.isRef()) { + OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() ); +- if ( oc->state() == OptionalContentGroup::On ) { ++ if ( oc && oc->state() == OptionalContentGroup::On ) { + return true; + } + } +@@ -283,7 +286,7 @@ bool OCGs::anyOff( Array *ocgArray ) + ocgArray->getNF(i, &ocgItem); + if (ocgItem.isRef()) { + OptionalContentGroup* oc = findOcgByRef( ocgItem.getRef() ); +- if ( oc->state() == OptionalContentGroup::Off ) { ++ if ( oc && oc->state() == OptionalContentGroup::Off ) { + return true; + } + } -- cgit v1.2.3