Hi,

The attached patch (against poppler 0.21.4) fixes a SIGFPE at line 422 of 
Stream.cc due to nBits == 0. Also attached the PDF to reproduce the bug.

Best regards,

Even
--- poppler/SplashOutputDev.cc.ori	2012-12-26 19:55:18.602161913 +0100
+++ poppler/SplashOutputDev.cc	2012-12-26 19:58:41.332302841 +0100
@@ -3568,6 +3568,11 @@
   mat[5] = ctm[3] + ctm[5];
 
   //----- set up the soft mask
+  
+  if( maskColorMap->getBits() <= 0 ) {
+    maskStr->close();
+    return;
+  }
 
   imgMaskData.imgStr = new ImageStream(maskStr, maskWidth,
 				       maskColorMap->getNumPixelComps(),
--- poppler/Stream.cc.ori	2012-12-26 19:47:30.292526621 +0100
+++ poppler/Stream.cc	2012-12-26 19:48:58.762064554 +0100
@@ -419,7 +419,7 @@
 
   nVals = width * nComps;
   inputLineSize = (nVals * nBits + 7) >> 3;
-  if (nVals > INT_MAX / nBits - 7) {
+  if (nBits <= 0 || nVals > INT_MAX / nBits - 7) {
     // force a call to gmallocn(-1,...), which will throw an exception
     inputLineSize = -1;
   }

Attachment: crash_imagestream_cstor_nbits_zero.pdf
Description: Adobe PDF document

_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to