Don't crash when calling cmsGetColorSpace()

Resolves: #1363669
This commit is contained in:
Marek Kasik 2016-09-26 13:58:47 +02:00
parent 55b63a4da1
commit 9560bc93e0
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 6d5a35324d49856569788bc4e471cc245f5a0774 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Wed, 21 Sep 2016 12:28:16 +0200
Subject: [PATCH] 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
---
poppler/GfxState.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 368ee27..b617012 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -2049,6 +2049,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));
--
2.9.3

View File

@ -1,7 +1,7 @@
Summary: PDF rendering library
Name: poppler
Version: 0.45.0
Release: 1%{?dist}
Release: 2%{?dist}
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
Group: Development/Libraries
URL: http://poppler.freedesktop.org/
@ -10,6 +10,9 @@ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=1185007
Patch0: poppler-0.30.0-rotated-words-selection.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1363669
Patch1: poppler-0.45.0-cmsGetColorSpace.patch
## upstreamable patches
# fix configure checks for moc versions
Patch50: poppler-0.24.2-mocversiongrep.patch
@ -148,6 +151,7 @@ Requires: %{name}-glib%{?_isa} = %{version}-%{release}
%prep
%setup -q
%patch0 -p1 -b .rotated-words-selection
%patch1 -p1 -b .cmsGetColorSpace
%patch50 -p1 -b .mocversiongrep
@ -283,6 +287,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
%changelog
* Mon Sep 26 2016 Marek Kasik <mkasik@redhat.com> - 0.45.0-2
- Don't crash when calling cmsGetColorSpace()
- Resolves: #1363669
* Mon Jul 18 2016 Marek Kasik <mkasik@redhat.com> - 0.45.0-1
- Update to 0.45.0
- Resolves: #1338421