[poppler] poppler/GfxState.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 3 22:28:19 UTC 2021


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

New commits:
commit d8032e79f45bb37e00c2d61cff8c21d6f1052d78
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Dec 2 20:16:34 2021 +0100

    GfxSeparationColorSpace: Check validity of colorspace and function
    
    Fixes issue #1184

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index f6d42400..c24332bd 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -2616,7 +2616,6 @@ GfxColorSpace *GfxSeparationColorSpace::copy() const
 //~ handle the 'All' and 'None' colorants
 GfxColorSpace *GfxSeparationColorSpace::parse(GfxResources *res, Array *arr, OutputDev *out, GfxState *state, int recursion)
 {
-    GfxSeparationColorSpace *cs;
     GooString *nameA;
     GfxColorSpace *altA;
     Function *funcA;
@@ -2645,8 +2644,9 @@ GfxColorSpace *GfxSeparationColorSpace::parse(GfxResources *res, Array *arr, Out
         error(errSyntaxWarning, -1, "Bad SeparationColorSpace function");
         goto err5;
     }
-    cs = new GfxSeparationColorSpace(nameA, altA, funcA);
-    return cs;
+    if (altA->getNComps() <= funcA->getOutputSize()) {
+        return new GfxSeparationColorSpace(nameA, altA, funcA);
+    }
 
 err5:
     delete funcA;
@@ -2695,11 +2695,6 @@ void GfxSeparationColorSpace::getRGB(const GfxColor *color, GfxRGB *rgb) const
         for (i = 0; i < altNComps; ++i) {
             color2.c[i] = dblToCol(c[i]);
         }
-        if (unlikely(altNComps > func->getOutputSize())) {
-            for (i = func->getOutputSize(); i < altNComps; ++i) {
-                color2.c[i] = 0;
-            }
-        }
         alt->getRGB(&color2, rgb);
     }
 }


More information about the poppler mailing list