[poppler] 2 commits - poppler/GfxState.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Dec 15 21:05:04 UTC 2016
poppler/GfxState.cc | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 1511523450f40b539fb1d58950a907f3712fd5c7
Author: Albert Astals Cid <aacid at kde.org>
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 <mkasik at redhat.com>
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 <hib at hiberis.nl>
// Copyright (C) 2013 Fabio D'Urso <fabiodurso at hotmail.it>
// Copyright (C) 2015 Adrian Johnson <ajohnson at redneon.com>
+// Copyright (C) 2016 Marek Kasik <mkasik at redhat.com>
//
// 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));
More information about the poppler
mailing list