[poppler] Branch 'poppler-0.20' - splash/Splash.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Aug 2 15:48:59 PDT 2012


 splash/Splash.cc |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 3ca2bc0d3abdf92741b7921ea402c9de09e531f6
Author: Markus Trippelsdorf <markus at trippelsdorf.de>
Date:   Fri Aug 3 00:48:12 2012 +0200

    Fix segfault when scaleImage returns NULL
    
    Bug 52488

diff --git a/splash/Splash.cc b/splash/Splash.cc
index d2d965a..e6559f4 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -16,6 +16,7 @@
 // Copyright (C) 2010-2012 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger at googlemail.com>
 // Copyright (C) 2011, 2012 William Bader <williambader at hotmail.com>
+// Copyright (C) 2012 Markus Trippelsdorf <markus at trippelsdorf.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -3435,6 +3436,9 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData,
       }
       scaledImg = scaleImage(src, srcData, srcMode, nComps, srcAlpha, w, h,
 			     scaledWidth, scaledHeight);
+      if (scaledImg == NULL) {
+        return splashErrBadArg;
+      }
       blitImage(scaledImg, srcAlpha, x0, y0, clipRes);
       delete scaledImg;
     }
@@ -3470,6 +3474,9 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData,
       }
       scaledImg = scaleImage(src, srcData, srcMode, nComps, srcAlpha, w, h,
 			     scaledWidth, scaledHeight);
+      if (scaledImg == NULL) {
+        return splashErrBadArg;
+      }
       vertFlipImage(scaledImg, scaledWidth, scaledHeight, nComps);
       blitImage(scaledImg, srcAlpha, x0, y0, clipRes);
       delete scaledImg;


More information about the poppler mailing list