[poppler] poppler/SplashOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Mar 26 08:09:13 PDT 2015


 poppler/SplashOutputDev.cc |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 0969801c12a6ec0fbc079c8203cece9c70466955
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Mar 26 16:08:20 2015 +0100

    Fix previous commit about initializing on failure
    
    It's the nComps of the destination not of the origin we need

diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 7ad4d44..a7cc6bc 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -2831,15 +2831,26 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
 #endif
   int nComps, x;
 
-  nComps = imgData->colorMap->getNumPixelComps();
   if (imgData->y == imgData->height) {
     return gFalse;
   }
   if (!(p = imgData->imgStr->getLine())) {
-    memset(colorLine, 0, imgData->width * nComps);
+    int destComps = 1;
+    if (imgData->colorMode == splashModeRGB8 || imgData->colorMode == splashModeBGR8)
+        destComps = 3;
+    else if (imgData->colorMode == splashModeXBGR8)
+        destComps = 4;
+#if SPLASH_CMYK
+    else if (imgData->colorMode == splashModeCMYK8)
+        destComps = 4;
+    else if (imgData->colorMode == splashModeDeviceN8)
+        destComps = SPOT_NCOMPS + 4;
+#endif
+    memset(colorLine, 0, imgData->width * destComps);
     return gFalse;
   }
 
+  nComps = imgData->colorMap->getNumPixelComps();
 
   if (imgData->lookup) {
     switch (imgData->colorMode) {


More information about the poppler mailing list