Thu Feb 26 20:23:02 2009 UTC ()
pull some patches from upstream, to fix two crashes and an off-by-one
in color management support, bump PKGREVISION


(drochner)
diff -r1.35 -r1.36 pkgsrc/print/poppler/Makefile
diff -r1.39 -r1.40 pkgsrc/print/poppler/distinfo
diff -r0 -r1.1 pkgsrc/print/poppler/patches/patch-ba
diff -r0 -r1.1 pkgsrc/print/poppler/patches/patch-bb
diff -r1.1 -r1.2 pkgsrc/print/poppler/patches/patch-ca

cvs diff -r1.35 -r1.36 pkgsrc/print/poppler/Makefile (expand / switch to unified diff)

--- pkgsrc/print/poppler/Makefile 2009/02/12 20:55:07 1.35
+++ pkgsrc/print/poppler/Makefile 2009/02/26 20:23:02 1.36
@@ -1,18 +1,20 @@ @@ -1,18 +1,20 @@
1# $NetBSD: Makefile,v 1.35 2009/02/12 20:55:07 drochner Exp $ 1# $NetBSD: Makefile,v 1.36 2009/02/26 20:23:02 drochner Exp $
2# 2#
3 3
4.include "../../print/poppler/Makefile.common" 4.include "../../print/poppler/Makefile.common"
5 5
 6PKGREVISION= 1
 7
6COMMENT= PDF rendering library 8COMMENT= PDF rendering library
7MAINTAINER= reed@reedmedia.net 9MAINTAINER= reed@reedmedia.net
8 10
9USE_TOOLS+= gmake 11USE_TOOLS+= gmake
10 12
11#PKGCONFIG_OVERRIDE+= ${WRKSRC}/poppler-cairo.pc.in 13#PKGCONFIG_OVERRIDE+= ${WRKSRC}/poppler-cairo.pc.in
12PKGCONFIG_OVERRIDE+= ${WRKSRC}/poppler-splash.pc.in 14PKGCONFIG_OVERRIDE+= ${WRKSRC}/poppler-splash.pc.in
13PKGCONFIG_OVERRIDE+= ${WRKSRC}/poppler.pc.in 15PKGCONFIG_OVERRIDE+= ${WRKSRC}/poppler.pc.in
14GNU_CONFIGURE= yes 16GNU_CONFIGURE= yes
15 17
16INSTALLATION_DIRS+= include/poppler share/doc/poppler 18INSTALLATION_DIRS+= include/poppler share/doc/poppler
17 19
18CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q} 20CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}

cvs diff -r1.39 -r1.40 pkgsrc/print/poppler/distinfo (expand / switch to unified diff)

--- pkgsrc/print/poppler/distinfo 2009/02/12 20:55:07 1.39
+++ pkgsrc/print/poppler/distinfo 2009/02/26 20:23:02 1.40
@@ -1,13 +1,15 @@ @@ -1,13 +1,15 @@
1$NetBSD: distinfo,v 1.39 2009/02/12 20:55:07 drochner Exp $ 1$NetBSD: distinfo,v 1.40 2009/02/26 20:23:02 drochner Exp $
2 2
3SHA1 (poppler-0.10.4.tar.gz) = e8a5a1090394a2cfab3c9aa67d188f3628c60165 3SHA1 (poppler-0.10.4.tar.gz) = e8a5a1090394a2cfab3c9aa67d188f3628c60165
4RMD160 (poppler-0.10.4.tar.gz) = 62815f486a4f1eaa226e84aa953134be6a209ed6 4RMD160 (poppler-0.10.4.tar.gz) = 62815f486a4f1eaa226e84aa953134be6a209ed6
5Size (poppler-0.10.4.tar.gz) = 1513213 bytes 5Size (poppler-0.10.4.tar.gz) = 1513213 bytes
6SHA1 (patch-aa) = 43c63c16d3a845e394a8eb0c3a321944fcf17615 6SHA1 (patch-aa) = 43c63c16d3a845e394a8eb0c3a321944fcf17615
7SHA1 (patch-ab) = 5a2785bccd71990e20cd81a3cd2697804e31788d 7SHA1 (patch-ab) = 5a2785bccd71990e20cd81a3cd2697804e31788d
8SHA1 (patch-ag) = 0bf1bc080cad55792fe6cc761bf22ecccba7d13a 8SHA1 (patch-ag) = 0bf1bc080cad55792fe6cc761bf22ecccba7d13a
9SHA1 (patch-ai) = 852332490394756c496d06eb109f3d1d637f8717 9SHA1 (patch-ai) = 852332490394756c496d06eb109f3d1d637f8717
10SHA1 (patch-aj) = 8bb1fe169bddb76ecc72129cc1dbd32030073dfd 10SHA1 (patch-aj) = 8bb1fe169bddb76ecc72129cc1dbd32030073dfd
11SHA1 (patch-ak) = ab4d0c91a6f2806b405954f8dab6e3d61a03b054 11SHA1 (patch-ak) = ab4d0c91a6f2806b405954f8dab6e3d61a03b054
12SHA1 (patch-ca) = ba4190663bc0c0e9a7d9477922665e0ed5d4c0e4 12SHA1 (patch-ba) = c53d76e13dc7afeb9410f4566ea917b83a76a133
 13SHA1 (patch-bb) = c9fa8638988e335f9d80cda25015d9a18d78fa94
 14SHA1 (patch-ca) = 5bd31c497c8cbfb6c1d6cb5b9183088113bef6e3
13SHA1 (patch-cb) = e8cfb16a0641788759b13cf5fcf97d82f9485adc 15SHA1 (patch-cb) = e8cfb16a0641788759b13cf5fcf97d82f9485adc

File Added: pkgsrc/print/poppler/patches/Attic/patch-ba
$NetBSD: patch-ba,v 1.1 2009/02/26 20:23:02 drochner Exp $

--- poppler/CairoOutputDev.cc.orig	2009-02-24 15:34:03.000000000 +0100
+++ poppler/CairoOutputDev.cc
@@ -236,7 +236,7 @@ void CairoOutputDev::setDefaultCTM(doubl
   matrix.y0 = ctm[5];
 
   cairo_transform (cairo, &matrix);
-  if (shape)
+  if (cairo_shape)
       cairo_transform (cairo_shape, &matrix);
 
   OutputDev::setDefaultCTM(ctm);

File Added: pkgsrc/print/poppler/patches/Attic/patch-bb
$NetBSD: patch-bb,v 1.1 2009/02/26 20:23:02 drochner Exp $

--- poppler/JBIG2Stream.cc.orig	2009-01-23 23:09:41.000000000 +0100
+++ poppler/JBIG2Stream.cc
@@ -684,6 +684,7 @@ public:
   void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp);
   Guchar *getDataPtr() { return data; }
   int getDataSize() { return h * line; }
+  GBool isOk() { return data != NULL; }
 
 private:
 
@@ -2074,18 +2075,20 @@ void JBIG2Stream::readTextRegionSeg(Guin
 
   gfree(syms);
 
-  // combine the region bitmap into the page bitmap
-  if (imm) {
-    if (pageH == 0xffffffff && y + h > curPageH) {
-      pageBitmap->expand(y + h, pageDefPixel);
-    }
-    pageBitmap->combine(bitmap, x, y, extCombOp);
-    delete bitmap;
+  if (bitmap) {
+    // combine the region bitmap into the page bitmap
+    if (imm) {
+      if (pageH == 0xffffffff && y + h > curPageH) {
+        pageBitmap->expand(y + h, pageDefPixel);
+      }
+      pageBitmap->combine(bitmap, x, y, extCombOp);
+      delete bitmap;
 
-  // store the region bitmap
-  } else {
-    bitmap->setSegNum(segNum);
-    segments->append(bitmap);
+    // store the region bitmap
+    } else {
+      bitmap->setSegNum(segNum);
+      segments->append(bitmap);
+    }
   }
 
   // clean up the Huffman decoder
@@ -2207,73 +2210,84 @@ JBIG2Bitmap *JBIG2Stream::readTextRegion
 	  ri = 0;
 	}
 	if (ri) {
+	  GBool decodeSuccess;
 	  if (huff) {
-	    huffDecoder->decodeInt(&rdw, huffRDWTable);
-	    huffDecoder->decodeInt(&rdh, huffRDHTable);
-	    huffDecoder->decodeInt(&rdx, huffRDXTable);
-	    huffDecoder->decodeInt(&rdy, huffRDYTable);
-	    huffDecoder->decodeInt(&bmSize, huffRSizeTable);
+	    decodeSuccess = huffDecoder->decodeInt(&rdw, huffRDWTable);
+	    decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdh, huffRDHTable);
+	    decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdx, huffRDXTable);
+	    decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdy, huffRDYTable);
+	    decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&bmSize, huffRSizeTable);
 	    huffDecoder->reset();
 	    arithDecoder->start();
 	  } else {
-	    arithDecoder->decodeInt(&rdw, iardwStats);
-	    arithDecoder->decodeInt(&rdh, iardhStats);
-	    arithDecoder->decodeInt(&rdx, iardxStats);
-	    arithDecoder->decodeInt(&rdy, iardyStats);
-	  }
-	  refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx;
-	  refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy;
-
-	  symbolBitmap =
-	    readGenericRefinementRegion(rdw + syms[symID]->getWidth(),
-					rdh + syms[symID]->getHeight(),
-					templ, gFalse, syms[symID],
-					refDX, refDY, atx, aty);
+	    decodeSuccess = arithDecoder->decodeInt(&rdw, iardwStats);
+	    decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdh, iardhStats);
+	    decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdx, iardxStats);
+	    decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdy, iardyStats);
+	  }
+	  
+	  if (decodeSuccess)
+	  {
+	    refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx;
+	    refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy;
+
+	    symbolBitmap =
+	      readGenericRefinementRegion(rdw + syms[symID]->getWidth(),
+					  rdh + syms[symID]->getHeight(),
+					  templ, gFalse, syms[symID],
+					  refDX, refDY, atx, aty);
+	  }
 	  //~ do we need to use the bmSize value here (in Huffman mode)?
 	} else {
 	  symbolBitmap = syms[symID];
 	}
 
-	// combine the symbol bitmap into the region bitmap
-	//~ something is wrong here - refCorner shouldn't degenerate into
-	//~   two cases
-	bw = symbolBitmap->getWidth() - 1;
-	bh = symbolBitmap->getHeight() - 1;
-	if (transposed) {
-	  switch (refCorner) {
-	  case 0: // bottom left
-	    bitmap->combine(symbolBitmap, tt, s, combOp);
-	    break;
-	  case 1: // top left
-	    bitmap->combine(symbolBitmap, tt, s, combOp);
-	    break;
-	  case 2: // bottom right
-	    bitmap->combine(symbolBitmap, tt - bw, s, combOp);
-	    break;
-	  case 3: // top right
-	    bitmap->combine(symbolBitmap, tt - bw, s, combOp);
-	    break;
+	if (symbolBitmap) {
+	  // combine the symbol bitmap into the region bitmap
+	  //~ something is wrong here - refCorner shouldn't degenerate into
+	  //~   two cases
+	  bw = symbolBitmap->getWidth() - 1;
+	  bh = symbolBitmap->getHeight() - 1;
+	  if (transposed) {
+	    switch (refCorner) {
+	    case 0: // bottom left
+	      bitmap->combine(symbolBitmap, tt, s, combOp);
+	      break;
+	    case 1: // top left
+	      bitmap->combine(symbolBitmap, tt, s, combOp);
+	      break;
+	    case 2: // bottom right
+	      bitmap->combine(symbolBitmap, tt - bw, s, combOp);
+	      break;
+	    case 3: // top right
+	      bitmap->combine(symbolBitmap, tt - bw, s, combOp);
+	      break;
+	    }
+	    s += bh;
+	  } else {
+	    switch (refCorner) {
+	    case 0: // bottom left
+	      bitmap->combine(symbolBitmap, s, tt - bh, combOp);
+	      break;
+	    case 1: // top left
+	      bitmap->combine(symbolBitmap, s, tt, combOp);
+	      break;
+	    case 2: // bottom right
+	      bitmap->combine(symbolBitmap, s, tt - bh, combOp);
+	      break;
+	    case 3: // top right
+	      bitmap->combine(symbolBitmap, s, tt, combOp);
+	      break;
+	    }
+	    s += bw;
 	  }
-	  s += bh;
-	} else {
-	  switch (refCorner) {
-	  case 0: // bottom left
-	    bitmap->combine(symbolBitmap, s, tt - bh, combOp);
-	    break;
-	  case 1: // top left
-	    bitmap->combine(symbolBitmap, s, tt, combOp);
-	    break;
-	  case 2: // bottom right
-	    bitmap->combine(symbolBitmap, s, tt - bh, combOp);
-	    break;
-	  case 3: // top right
-	    bitmap->combine(symbolBitmap, s, tt, combOp);
-	    break;
+	  if (ri) {
+	    delete symbolBitmap;
 	  }
-	  s += bw;
-	}
-	if (ri) {
-	  delete symbolBitmap;
+	} else {
+	  // NULL symbolBitmap only happens on error
+	  delete bitmap;
+	  return NULL;
 	}
       }
 
@@ -3052,6 +3066,11 @@ JBIG2Bitmap *JBIG2Stream::readGenericRef
   int x, y, pix;
 
   bitmap = new JBIG2Bitmap(0, w, h);
+  if (!bitmap->isOk())
+  {
+    delete bitmap;
+    return NULL;
+  }
   bitmap->clearToZero();
 
   // set up the typical row context

cvs diff -r1.1 -r1.2 pkgsrc/print/poppler/patches/Attic/patch-ca (expand / switch to unified diff)

--- pkgsrc/print/poppler/patches/Attic/patch-ca 2009/02/12 20:55:07 1.1
+++ pkgsrc/print/poppler/patches/Attic/patch-ca 2009/02/26 20:23:02 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-ca,v 1.1 2009/02/12 20:55:07 drochner Exp $ 1$NetBSD: patch-ca,v 1.2 2009/02/26 20:23:02 drochner Exp $
2 2
3--- poppler/GfxState.cc.orig 2008-11-05 22:49:26.000000000 +0100 3--- poppler/GfxState.cc.orig 2008-11-05 22:49:26.000000000 +0100
4+++ poppler/GfxState.cc 4+++ poppler/GfxState.cc
5@@ -39,6 +39,7 @@ 5@@ -39,6 +39,7 @@
6 #include "Page.h" 6 #include "Page.h"
7 #include "GfxState.h" 7 #include "GfxState.h"
8 #include "GfxFont.h" 8 #include "GfxFont.h"
9+#include "GlobalParams.h" 9+#include "GlobalParams.h"
10  10
11 //------------------------------------------------------------------------ 11 //------------------------------------------------------------------------
12  12
13@@ -224,6 +225,225 @@ void GfxColorSpace::getRGBLine(Guchar *i 13@@ -224,6 +225,225 @@ void GfxColorSpace::getRGBLine(Guchar *i
14 } 14 }
@@ -902,27 +902,27 @@ $NetBSD: patch-ca,v 1.1 2009/02/12 20:55 @@ -902,27 +902,27 @@ $NetBSD: patch-ca,v 1.1 2009/02/12 20:55
902+ } 902+ }
903+ } 903+ }
904+ return NULL; 904+ return NULL;
905+} 905+}
906+ 906+
907+void GfxICCBasedCache::put(int numA, int genA, 907+void GfxICCBasedCache::put(int numA, int genA,
908+ GfxICCBasedColorSpace *cs) 908+ GfxICCBasedColorSpace *cs)
909+{ 909+{
910+ int i; 910+ int i;
911+ 911+
912+ if (cache[GFX_ICCBASED_CACHE_SIZE-1].num > 0) { 912+ if (cache[GFX_ICCBASED_CACHE_SIZE-1].num > 0) {
913+ delete cache[GFX_ICCBASED_CACHE_SIZE-1].colorSpace; 913+ delete cache[GFX_ICCBASED_CACHE_SIZE-1].colorSpace;
914+ } 914+ }
915+ for (i = GFX_ICCBASED_CACHE_SIZE; i > 0; i--) { 915+ for (i = GFX_ICCBASED_CACHE_SIZE-1; i > 0; i--) {
916+ if (cache[i - 1].num > 0) cache[i] = cache[i - 1]; 916+ if (cache[i - 1].num > 0) cache[i] = cache[i - 1];
917+ } 917+ }
918+ cache[0].num = numA; 918+ cache[0].num = numA;
919+ cache[0].gen = genA; 919+ cache[0].gen = genA;
920+ cache[0].colorSpace = (GfxICCBasedColorSpace *)cs->copy(); 920+ cache[0].colorSpace = (GfxICCBasedColorSpace *)cs->copy();
921+} 921+}
922+#endif 922+#endif
923+ 923+
924 //------------------------------------------------------------------------ 924 //------------------------------------------------------------------------
925 // GfxIndexedColorSpace 925 // GfxIndexedColorSpace
926 //------------------------------------------------------------------------ 926 //------------------------------------------------------------------------
927@@ -3938,6 +4585,9 @@ GfxState::GfxState(double hDPIA, double  927@@ -3938,6 +4585,9 @@ GfxState::GfxState(double hDPIA, double
928 clipYMax = pageHeight; 928 clipYMax = pageHeight;