Avoid global display profile state leaking uncontrollably
Resolves: #1646549
This commit is contained in:
parent
7d52843d6e
commit
f513561f6c
63
poppler-0.67.0-display-profile.patch
Normal file
63
poppler-0.67.0-display-profile.patch
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
From e07c8b4784234383cb5ddcf1133ea91a772506e2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Adam Reichold <adam.reichold@t-online.de>
|
||||||
|
Date: Tue, 1 Jan 2019 10:54:40 +0100
|
||||||
|
Subject: [PATCH] Avoid global display profile state becoming an uncontrolled
|
||||||
|
memory leak by enforcing single initialization. Closes #654
|
||||||
|
|
||||||
|
---
|
||||||
|
poppler/GfxState.cc | 9 +++++++++
|
||||||
|
qt5/src/poppler-qt5.h | 4 ++++
|
||||||
|
2 files changed, 13 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
|
||||||
|
index 87b7ce03..4e3ccbfd 100644
|
||||||
|
--- a/poppler/GfxState.cc
|
||||||
|
+++ b/poppler/GfxState.cc
|
||||||
|
@@ -226,6 +226,10 @@ static unsigned int getCMSNChannels(cmsColorSpaceSignature cs);
|
||||||
|
static cmsHPROFILE loadColorProfile(const char *fileName);
|
||||||
|
|
||||||
|
void GfxColorSpace::setDisplayProfile(void *displayProfileA) {
|
||||||
|
+ if (displayProfile != nullptr) {
|
||||||
|
+ error(errInternal, -1, "The display color profile can only be set once before any rendering is done.");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
displayProfile = displayProfileA;
|
||||||
|
if (displayProfile != nullptr) {
|
||||||
|
cmsHTRANSFORM transform;
|
||||||
|
@@ -249,6 +253,11 @@ void GfxColorSpace::setDisplayProfile(void *displayProfileA) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void GfxColorSpace::setDisplayProfileName(GooString *name) {
|
||||||
|
+ if (displayProfile != nullptr) {
|
||||||
|
+ error(errInternal, -1, "The display color profile can only be set before any rendering is done.");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ delete displayProfileName;
|
||||||
|
displayProfileName = name->copy();
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h
|
||||||
|
index 4f06c47e..ddac7dfb 100644
|
||||||
|
--- a/qt5/src/poppler-qt5.h
|
||||||
|
+++ b/qt5/src/poppler-qt5.h
|
||||||
|
@@ -1102,6 +1102,8 @@ delete it;
|
||||||
|
|
||||||
|
\param outputProfileA is a \c cmsHPROFILE of the LCMS library.
|
||||||
|
|
||||||
|
+ \note This should be called before any rendering happens and only once during the lifetime of the current process.
|
||||||
|
+
|
||||||
|
\since 0.12
|
||||||
|
*/
|
||||||
|
void setColorDisplayProfile(void *outputProfileA);
|
||||||
|
@@ -1110,6 +1112,8 @@ delete it;
|
||||||
|
|
||||||
|
\param name is the name of the display profile to set.
|
||||||
|
|
||||||
|
+ \note This should be called before any rendering happens.
|
||||||
|
+
|
||||||
|
\since 0.12
|
||||||
|
*/
|
||||||
|
void setColorDisplayProfileName(const QString &name);
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
10
poppler.spec
10
poppler.spec
@ -4,7 +4,7 @@
|
|||||||
Summary: PDF rendering library
|
Summary: PDF rendering library
|
||||||
Name: poppler
|
Name: poppler
|
||||||
Version: 0.67.0
|
Version: 0.67.0
|
||||||
Release: 9%{?dist}
|
Release: 10%{?dist}
|
||||||
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
|
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
|
||||||
URL: http://poppler.freedesktop.org/
|
URL: http://poppler.freedesktop.org/
|
||||||
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
|
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
|
||||||
@ -46,6 +46,9 @@ Patch14: poppler-0.67.0-filespec.patch
|
|||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1665266
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1665266
|
||||||
Patch15: poppler-0.67.0-dummy-xref-entry.patch
|
Patch15: poppler-0.67.0-dummy-xref-entry.patch
|
||||||
|
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1646546
|
||||||
|
Patch16: poppler-0.67.0-display-profile.patch
|
||||||
|
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: gettext-devel
|
BuildRequires: gettext-devel
|
||||||
@ -276,6 +279,11 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
|||||||
%{_mandir}/man1/*
|
%{_mandir}/man1/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 22 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-10
|
||||||
|
- Avoid global display profile state becoming an uncontrolled
|
||||||
|
- memory leak
|
||||||
|
- Resolves: #1646549
|
||||||
|
|
||||||
* Mon Jan 21 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-9
|
* Mon Jan 21 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-9
|
||||||
- Do not try to parse into unallocated XRef entry
|
- Do not try to parse into unallocated XRef entry
|
||||||
- Resolves: #1665268
|
- Resolves: #1665268
|
||||||
|
Loading…
Reference in New Issue
Block a user