[poppler] poppler/GfxState.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Jun 6 15:46:58 UTC 2018


 poppler/GfxState.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit d6a3dc3ebbc97fcdd3c45028b5741f4b99fc0279
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Jun 6 17:46:17 2018 +0200

    GfxAxialShading::parse: Fix memory leak on broken files
    
    fixes oss-fuzz/8742

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index ef5d287e..d3204795 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -4070,7 +4070,6 @@ GfxAxialShading *GfxAxialShading::parse(GfxResources *res, Dict *dict, OutputDev
   int nFuncsA;
   GBool extend0A, extend1A;
   Object obj1;
-  int i;
 
   x0A = y0A = x1A = y1A = 0;
   obj1 = dict->lookup("Coords");
@@ -4109,9 +4108,11 @@ GfxAxialShading *GfxAxialShading::parse(GfxResources *res, Dict *dict, OutputDev
       error(errSyntaxWarning, -1, "Invalid Function array in shading dictionary");
       return nullptr;
     }
-    for (i = 0; i < nFuncsA; ++i) {
+    for (int i = 0; i < nFuncsA; ++i) {
       Object obj2 = obj1.arrayGet(i);
       if (!(funcsA[i] = Function::parse(&obj2))) {
+	for (int j = 0; j < i; ++j)
+	  delete funcsA[j];
 	return nullptr;
       }
     }


More information about the poppler mailing list