[poppler] splash/Splash.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 20 21:21:27 UTC 2018


 splash/Splash.cc |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 8ff1bddc6a97a5f8b43ff95405f0642fb03f962b
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Sep 20 23:21:02 2018 +0200

    Splash::scaleImageYdXd: gmallocn -> gmallocn_checkoverflow
    
    oss-fuzz/10205

diff --git a/splash/Splash.cc b/splash/Splash.cc
index 9d356b99..184659f5 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -4244,7 +4244,11 @@ void Splash::scaleImageYdXd(SplashImageSource src, void *srcData,
 
   // allocate buffers
   lineBuf = (Guchar *)gmallocn(srcWidth, nComps);
-  pixBuf = (Guint *)gmallocn(srcWidth, nComps * sizeof(int));
+  pixBuf = (Guint *)gmallocn_checkoverflow(srcWidth, nComps * sizeof(int));
+  if (unlikely(!pixBuf)) {
+    gfree(lineBuf);
+    return;
+  }
   if (srcAlpha) {
     alphaLineBuf = (Guchar *)gmalloc(srcWidth);
     alphaPixBuf = (Guint *)gmallocn(srcWidth, sizeof(int));


More information about the poppler mailing list