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

New commits:
commit 1511523450f40b539fb1d58950a907f3712fd5c7
Author: Albert Astals Cid <[email protected]>
Date:   Thu Dec 15 22:04:04 2016 +0100

    Refine previous fix a bit
    
    Call GfxColorSpace::setupColorProfiles only when we really need it

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 7fcc3a2..6ac1874 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -2050,9 +2050,13 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, 
OutputDev *out, GfxState
   if (hp == 0) {
     error(errSyntaxWarning, -1, "read ICCBased color space profile error");
   } else {
-    GfxColorSpace::setupColorProfiles();
     cmsHPROFILE dhp = (state != NULL && state->getDisplayProfile() != NULL) ? 
state->getDisplayProfile() : displayProfile;
-    if (dhp == NULL) dhp = RGBProfile;
+    if (dhp == NULL) {
+      if (unlikely(RGBProfile == NULL)) {
+        GfxColorSpace::setupColorProfiles();
+      }
+      dhp = RGBProfile;
+    }
     unsigned int cst = getCMSColorSpaceType(cmsGetColorSpace(hp));
     unsigned int dNChannels = getCMSNChannels(cmsGetColorSpace(dhp));
     unsigned int dcst = getCMSColorSpaceType(cmsGetColorSpace(dhp));
commit 9b016440725de086fa87fcbf776e27acee2c01b7
Author: Marek Kasik <[email protected]>
Date:   Wed Sep 21 12:28:16 2016 +0200

    Don't crash when calling cmsGetColorSpace()
    
    Initialize RGBProfile and displayProfile before their use
    if they were not initialized in GfxState's constructor.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=97870

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 368ee27..7fcc3a2 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -28,6 +28,7 @@
 // Copyright (C) 2013 Hib Eris <[email protected]>
 // Copyright (C) 2013 Fabio D'Urso <[email protected]>
 // Copyright (C) 2015 Adrian Johnson <[email protected]>
+// Copyright (C) 2016 Marek Kasik <[email protected]>
 //
 // 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
@@ -2049,6 +2050,7 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, 
OutputDev *out, GfxState
   if (hp == 0) {
     error(errSyntaxWarning, -1, "read ICCBased color space profile error");
   } else {
+    GfxColorSpace::setupColorProfiles();
     cmsHPROFILE dhp = (state != NULL && state->getDisplayProfile() != NULL) ? 
state->getDisplayProfile() : displayProfile;
     if (dhp == NULL) dhp = RGBProfile;
     unsigned int cst = getCMSColorSpaceType(cmsGetColorSpace(hp));
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to