diff options
author | Marek Kasik <mkasik@redhat.com> | 2016-09-21 12:28:16 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2016-12-15 22:02:30 +0100 |
commit | 9b016440725de086fa87fcbf776e27acee2c01b7 (patch) | |
tree | ce6940e8f22bb08b4d0942035f713b683da5f1f4 | |
parent | 8321b400adf6c042cd630ceea7f54fcf6862211d (diff) |
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
-rw-r--r-- | poppler/GfxState.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index 368ee277..7fcc3a2c 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -28,6 +28,7 @@ // Copyright (C) 2013 Hib Eris <hib@hiberis.nl> // Copyright (C) 2013 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2015 Adrian Johnson <ajohnson@redneon.com> +// Copyright (C) 2016 Marek Kasik <mkasik@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)); |