[poppler] poppler/GfxState.cc

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


 poppler/GfxState.cc |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b5db021a71e38d56079cbcfcaf3345765e9ed782
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Sep 20 23:10:55 2018 +0200

    GfxUnivariateShading::setupCache: gmallocn -> gmallocn_checkoverflow
    
    oss-fuzz/10508

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index c2ff6d02..b8423f23 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -4008,7 +4008,9 @@ void GfxUnivariateShading::setupCache(const Matrix *ctm,
     tMax = t0 + sMin * (t1 - t0);
   }
 
-  cacheBounds = (double *)gmallocn(maxSize, sizeof(double) * (nComps + 2));
+  cacheBounds = (double *)gmallocn_checkoverflow(maxSize, sizeof(double) * (nComps + 2));
+  if (unlikely(!cacheBounds))
+    return;
   cacheCoeff = cacheBounds + maxSize;
   cacheValues = cacheCoeff + maxSize;
 


More information about the poppler mailing list