Compare commits

...

No commits in common. "c9s" and "c8" have entirely different histories.
c9s ... c8

24 changed files with 481 additions and 783 deletions

14
.gitignore vendored
View File

@ -1,12 +1,2 @@
/poppler-test-2009-05-13_0d2bfd4af4c76a3bac27ccaff793d9129df7b57a.tar.xz SOURCES/poppler-20.11.0.tar.xz
/poppler-0.61.1.tar.xz SOURCES/poppler-test-2009-05-13_0d2bfd4af4c76a3bac27ccaff793d9129df7b57a.tar.xz
/poppler-0.62.0.tar.xz
/poppler-0.63.0.tar.xz
/poppler-0.67.0.tar.xz
/poppler-0.73.0.tar.xz
/poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz
/poppler-0.84.0.tar.xz
/poppler-0.90.0.tar.xz
/poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz
/poppler-21.01.0.tar.xz
/poppler-test-2021-06-14.tar.xz

2
.poppler.metadata Normal file
View File

@ -0,0 +1,2 @@
0aa751121aed6ee2220ef3ea16b9df8f9b2e81c1 SOURCES/poppler-20.11.0.tar.xz
b58229322eb8f44a2bb1d98114b9fa3dfbef6a0a SOURCES/poppler-test-2009-05-13_0d2bfd4af4c76a3bac27ccaff793d9129df7b57a.tar.xz

View File

@ -0,0 +1,205 @@
--- poppler/glib/poppler-document.cc
+++ poppler/glib/poppler-document.cc
@@ -3405,6 +3405,7 @@ PopplerFormField *poppler_document_get_f
unsigned fieldNum;
FormPageWidgets *widgets;
FormWidget *field;
+ PopplerFormField *formField;
FormWidget::decodeID(id, &pageNum, &fieldNum);
@@ -3417,8 +3418,14 @@ PopplerFormField *poppler_document_get_f
return nullptr;
field = widgets->getWidget(fieldNum);
- if (field)
- return _poppler_form_field_new(document, field);
+ if (field) {
+ formField = _poppler_form_field_new(document, field);
+ delete widgets;
+
+ return formField;
+ }
+
+ delete widgets;
return nullptr;
}
--- poppler/poppler/CairoOutputDev.cc
+++ poppler/poppler/CairoOutputDev.cc
@@ -2921,8 +2921,10 @@ void CairoOutputDev::setMimeData(GfxStat
// colorspace in stream dict may be different from colorspace in jpx
// data
- if (strKind == strJPX && colorSpace)
+ if (strKind == strJPX && colorSpace) {
+ delete colorSpace;
return;
+ }
// only embed mime data for gray, rgb, and cmyk colorspaces.
if (colorSpace) {
--- poppler/poppler/TextOutputDev.cc
+++ poppler/poppler/TextOutputDev.cc
@@ -1619,7 +1619,6 @@ TextBlock::~TextBlock()
void TextBlock::addWord(TextWord *word)
{
- pool->addWord(word);
if (xMin > xMax) {
xMin = word->xMin;
xMax = word->xMax;
@@ -1639,6 +1638,7 @@ void TextBlock::addWord(TextWord *word)
yMax = word->yMax;
}
}
+ pool->addWord(word);
}
void TextBlock::coalesce(const UnicodeMap *uMap, double fixedPitch)
@@ -3064,11 +3064,13 @@ void TextPage::coalesce(bool physLayout,
word0 = pool->getPool(startBaseIdx);
pool->setPool(startBaseIdx, word0->next);
word0->next = nullptr;
- blk = new TextBlock(this, rot);
- blk->addWord(word0);
fontSize = word0->fontSize;
minBase = maxBase = word0->base;
+
+ blk = new TextBlock(this, rot);
+ blk->addWord(word0);
+
colSpace1 = minColSpacing1 * fontSize;
colSpace2 = minColSpacing2 * fontSize;
lineSpace = maxLineSpacingDelta * fontSize;
@@ -3095,9 +3097,9 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
+ newMinBase = word2->base;
blk->addWord(word2);
found = true;
- newMinBase = word2->base;
} else {
word0 = word1;
word1 = word1->next;
@@ -3123,9 +3125,9 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
+ newMaxBase = word2->base;
blk->addWord(word2);
found = true;
- newMaxBase = word2->base;
} else {
word0 = word1;
word1 = word1->next;
@@ -3198,12 +3200,12 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
- blk->addWord(word2);
if (word2->base < minBase) {
minBase = word2->base;
} else if (word2->base > maxBase) {
maxBase = word2->base;
}
+ blk->addWord(word2);
found = true;
break;
} else {
@@ -3246,12 +3248,12 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
- blk->addWord(word2);
if (word2->base < minBase) {
minBase = word2->base;
} else if (word2->base > maxBase) {
maxBase = word2->base;
}
+ blk->addWord(word2);
found = true;
break;
} else {
--- poppler/poppler/XRef.cc
+++ poppler/poppler/XRef.cc
@@ -402,6 +402,7 @@ int XRef::reserve(int newSize)
void *p = greallocn_checkoverflow(entries, realNewSize, sizeof(XRefEntry));
if (p == nullptr) {
+ entries = nullptr;
return 0;
}
@@ -835,7 +836,6 @@ bool XRef::constructXRef(bool *wasRecons
int offset = 0;
resize(0); // free entries properly
- gfree(entries);
capacity = 0;
size = 0;
entries = nullptr;
--- poppler/test/pdf-inspector.cc
+++ poppler/test/pdf-inspector.cc
@@ -43,6 +43,7 @@ class PdfInspector
{
public:
PdfInspector();
+ ~PdfInspector();
void set_file_name(const char *file_name);
void load(const char *file_name);
@@ -108,6 +109,11 @@ PdfInspector::PdfInspector()
load(nullptr);
}
+PdfInspector::~PdfInspector(void)
+{
+ delete output;
+}
+
void PdfInspector::set_file_name(const char *file_name)
{
GtkWidget *widget;
--- poppler/utils/HtmlOutputDev.cc
+++ poppler/utils/HtmlOutputDev.cc
@@ -1337,6 +1337,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
// TODO can we calculate the resolution of the image?
if (!writer->init(f1, width, height, 72, 72)) {
error(errInternal, -1, "Can't init PNG for image '{0:t}'", fName);
+ delete fName;
delete writer;
fclose(f1);
return;
--- poppler/utils/pdftotext.cc
+++ poppler/utils/pdftotext.cc
@@ -329,6 +329,7 @@ int main(int argc, char *argv[])
fputs("<pre>\n", f);
if (f != stdout) {
fclose(f);
+ f = nullptr;
}
}
}
@@ -348,8 +349,9 @@ int main(int argc, char *argv[])
printWordBBox(f, doc, textOut, firstPage, lastPage);
}
}
- if (f != stdout) {
+ if (f != stdout && f != nullptr) {
fclose(f);
+ f = nullptr;
}
} else {
textOut = new TextOutputDev(textFileName->c_str(), physLayout, fixedPitch, rawOrder, htmlMeta, discardDiag);
@@ -390,7 +392,7 @@ int main(int argc, char *argv[])
fputs("</pre>\n", f);
fputs("</body>\n", f);
fputs("</html>\n", f);
- if (f != stdout) {
+ if (f != stdout && f != nullptr) {
fclose(f);
}
}

View File

@ -1041,7 +1041,7 @@ index f0a5a1a0..dcaade6f 100644
--- a/poppler/poppler-config.h.cmake --- a/poppler/poppler-config.h.cmake
+++ b/poppler/poppler-config.h.cmake +++ b/poppler/poppler-config.h.cmake
@@ -115,6 +115,12 @@ @@ -115,6 +115,12 @@
#cmakedefine HAVE_SPLASH 1 #cmakedefine USE_BOOST_HEADERS 1
#endif #endif
+/* Build against libnss3 for digital signature validation and +/* Build against libnss3 for digital signature validation and

View File

@ -0,0 +1,35 @@
From 4f478daa6a9734b8f269a6586bdce2909844bb6f Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Wed, 23 Dec 2020 23:52:58 +0100
Subject: Fix opening files by some generators that are a bit broken
But Adobe opens it and it's easy to fix
diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 66d3f04a..c36c747a 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -45,6 +45,7 @@
#include <cctype>
#include <climits>
#include <cfloat>
+#include <limits>
#include "goo/gfile.h"
#include "goo/gmem.h"
#include "Object.h"
@@ -793,8 +794,13 @@ bool XRef::readXRefStreamSection(Stream *xrefStr, const int *w, int first, int n
gen = (gen << 8) + c;
}
if (gen > INT_MAX) {
- error(errSyntaxError, -1, "Gen inside xref table too large (bigger than INT_MAX)");
- return false;
+ if (i == 0 && gen == std::numeric_limits<uint32_t>::max()) {
+ // workaround broken generators
+ gen = 65535;
+ } else {
+ error(errSyntaxError, -1, "Gen inside xref table too large (bigger than INT_MAX)");
+ return false;
+ }
}
if (entries[i].offset == -1) {
switch (type) {

View File

@ -0,0 +1,30 @@
--- poppler-20.11.0/glib/poppler-attachment.cc
+++ poppler-20.11.0/glib/poppler-attachment.cc
@@ -114,17 +114,21 @@ PopplerAttachment *_poppler_attachment_n
if (embFile->createDate()) {
priv->ctime = _poppler_convert_pdf_date_to_date_time(embFile->createDate());
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- /* This will overflow on dates from after 2038. This field is
- * deprecated, only kept for backward compatibility. */
- attachment->ctime = (GTime)g_date_time_to_unix(priv->ctime);
+ if (priv->ctime != NULL) {
+ /* This will overflow on dates from after 2038. This field is
+ * deprecated, only kept for backward compatibility. */
+ attachment->ctime = (GTime)g_date_time_to_unix(priv->ctime);
+ }
G_GNUC_END_IGNORE_DEPRECATIONS
}
if (embFile->modDate()) {
priv->mtime = _poppler_convert_pdf_date_to_date_time(embFile->modDate());
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- /* This will overflow on dates from after 2038. This field is
- * deprecated, only kept for backward compatibility. */
- attachment->mtime = (GTime)g_date_time_to_unix(priv->mtime);
+ if (priv->mtime != NULL) {
+ /* This will overflow on dates from after 2038. This field is
+ * deprecated, only kept for backward compatibility. */
+ attachment->mtime = (GTime)g_date_time_to_unix(priv->mtime);
+ }
G_GNUC_END_IGNORE_DEPRECATIONS
}

View File

@ -0,0 +1,45 @@
From 3cc28b66132e66ed2dfe13a9a285ac41ac7267d5 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Wed, 23 Dec 2020 23:27:02 +0100
Subject: [PATCH] FoFiType1C: Fix crashes with broken files
---
fofi/FoFiType1C.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index 0387b0a87..4c2e9a770 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -194,7 +194,6 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, bo
Type1CIndexVal val;
GooString *buf;
char buf2[256];
- const char **enc;
bool ok;
int i;
@@ -299,9 +298,9 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, bo
} else {
(*outputFunc)(outputStream, "256 array\n", 10);
(*outputFunc)(outputStream, "0 1 255 {1 index exch /.notdef put} for\n", 40);
- enc = newEncoding ? newEncoding : (const char **)encoding;
+ const char **enc = newEncoding ? newEncoding : (const char **)encoding;
for (i = 0; i < 256; ++i) {
- if (enc[i]) {
+ if (enc && enc[i]) {
buf = GooString::format("dup {0:d} /{1:s} put\n", i, enc[i]);
(*outputFunc)(outputStream, buf->c_str(), buf->getLength());
delete buf;
@@ -1945,7 +1944,7 @@ bool FoFiType1C::parse()
readPrivateDict(0, 0, &privateDicts[0]);
} else {
getIndex(topDict.fdArrayOffset, &fdIdx, &parsedOk);
- if (!parsedOk) {
+ if (!parsedOk || fdIdx.len <= 0) {
return false;
}
nFDs = fdIdx.len;
--
GitLab

View File

@ -1,61 +1,57 @@
%global test_date 2021-06-14 %global test_sha 0d2bfd4af4c76a3bac27ccaff793d9129df7b57a
%global test_date 2009-05-13
Summary: PDF rendering library Summary: PDF rendering library
Name: poppler Name: poppler
Version: 21.01.0 Version: 20.11.0
Release: 21%{?dist} Release: 12%{?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
# git archive --prefix test/ # git archive --prefix test/
Source1: %{name}-test-%{test_date}.tar.xz Source1: %{name}-test-%{test_date}_%{test_sha}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=1185007 # https://bugzilla.redhat.com/show_bug.cgi?id=1185007
Patch0: poppler-0.30.0-rotated-words-selection.patch Patch0: poppler-0.30.0-rotated-words-selection.patch
Patch1: poppler-0.90.0-position-independent-code.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1602662
# https://bugzilla.redhat.com/show_bug.cgi?id=1638712
Patch4: poppler-0.66.0-covscan.patch
# Bogus volatiles detected by gcc-11 # https://bugzilla.redhat.com/show_bug.cgi?id=1618766
Patch2: %{name}-gcc11.patch Patch21: poppler-0.66.0-nss.patch
Patch3: poppler-21.01.0-glib-introspection.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1981108
Patch22: poppler-20.11.0-check-gdatetime.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1944726 # https://bugzilla.redhat.com/show_bug.cgi?id=2002575
Patch4: poppler-21.01.0-nss.patch Patch23: poppler-20.11.0-bad-generation.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1968289
Patch5: poppler-21.01.0-show-annotation-text.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1967967
Patch6: poppler-21.01.0-covscan.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2087190 # https://bugzilla.redhat.com/show_bug.cgi?id=2087190
Patch7: poppler-21.01.0-hints.patch Patch24: poppler-20.11.0-hints.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2124527 # https://bugzilla.redhat.com/show_bug.cgi?id=2124527
Patch8: poppler-21.01.0-jbig-symbol-overflow.patch Patch25: poppler-20.11.0-jbig-symbol-overflow.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189815 # https://bugzilla.redhat.com/show_bug.cgi?id=2189815
Patch9: poppler-21.01.0-pdfunite-broken-document.patch Patch26: poppler-20.11.0-pdfunite-broken-document.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189811 # https://bugzilla.redhat.com/show_bug.cgi?id=2189811
Patch10: poppler-21.01.0-pdfunite-check-isDict.patch Patch27: poppler-20.11.0-pdfunite-check-isDict.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189814 # https://bugzilla.redhat.com/show_bug.cgi?id=2189814
Patch11: poppler-21.01.0-check-isDict.patch Patch28: poppler-20.11.0-check-isDict.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189810 # https://bugzilla.redhat.com/show_bug.cgi?id=2189810
Patch12: poppler-21.01.0-XRef-check-isDict.patch Patch29: poppler-20.11.0-XRef-check-isDict.patch
# https://issues.redhat.com/browse/RHEL-31934 # https://issues.redhat.com/browse/RHEL-4255
Patch13: poppler-21.01.0-copy-filename.patch Patch30: poppler-20.11.0-fix-crash-in-FoFiType1C.patch
# https://issues.redhat.com/browse/RHEL-44333 # https://issues.redhat.com/browse/RHEL-44330
Patch14: poppler-21.01.0-pdfinfo-dests.patch Patch31: poppler-20.11.0-pdfinfo-dests.patch
BuildRequires: make
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gettext-devel BuildRequires: gettext-devel
BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(cairo)
BuildRequires: pkgconfig(cairo-ft) BuildRequires: pkgconfig(cairo-ft)
@ -82,6 +78,7 @@ BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Xml) BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: python3-devel
Requires: poppler-data Requires: poppler-data
@ -124,7 +121,6 @@ BuildArch: noarch
%package qt5 %package qt5
Summary: Qt5 wrapper for poppler Summary: Qt5 wrapper for poppler
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-qt < 0.90.0-9
%description qt5 %description qt5
%{summary}. %{summary}.
@ -133,7 +129,6 @@ Summary: Development files for Qt5 wrapper
Requires: %{name}-qt5%{?_isa} = %{version}-%{release} Requires: %{name}-qt5%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: qt5-qtbase-devel Requires: qt5-qtbase-devel
Obsoletes: %{name}-qt-devel < 0.90.0-9
%description qt5-devel %description qt5-devel
%{summary}. %{summary}.
@ -161,48 +156,61 @@ other formats.
%prep %prep
%autosetup -p1 -b 1 %autosetup -p1 -b 1
chmod -x poppler/CairoFontEngine.cc chmod -x poppler/CairoFontEngine.cc
%build %build
mkdir build
cd build
export CC="gcc -fPIC" # hack to make the cmake call pass
%cmake \ %cmake \
-DENABLE_CMS=lcms2 \ -DENABLE_CMS=lcms2 \
-DENABLE_DCTDECODER=libjpeg \ -DENABLE_DCTDECODER=libjpeg \
-DENABLE_GTK_DOC=ON \ -DENABLE_GTK_DOC=ON \
-DENABLE_LIBOPENJPEG=openjpeg2 \ -DENABLE_LIBOPENJPEG=openjpeg2 \
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
-DENABLE_ZLIB=OFF \ -DENABLE_ZLIB=OFF \
-DENABLE_NSS=ON \
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
-DENABLE_QT6=OFF \
.. ..
%cmake_build unset CC
make %{?_smp_mflags}
%install %install
%cmake_install cd build
make install DESTDIR=$RPM_BUILD_ROOT
%check %check
%make_build test make %{?_smp_mflags} test
# verify pkg-config sanity/version # verify pkg-config sanity/version
export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig
test "$(pkg-config --modversion poppler)" = "%{version}" test "$(pkg-config --modversion poppler)" = "%{version}"
test "$(pkg-config --modversion poppler-cairo)" = "%{version}"
test "$(pkg-config --modversion poppler-cpp)" = "%{version}" test "$(pkg-config --modversion poppler-cpp)" = "%{version}"
test "$(pkg-config --modversion poppler-glib)" = "%{version}" test "$(pkg-config --modversion poppler-glib)" = "%{version}"
test "$(pkg-config --modversion poppler-qt5)" = "%{version}" test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
test "$(pkg-config --modversion poppler-splash)" = "%{version}"
%ldconfig_scriptlets %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets glib %post glib -p /sbin/ldconfig
%postun glib -p /sbin/ldconfig
%ldconfig_scriptlets qt5 %post qt5 -p /sbin/ldconfig
%postun qt5 -p /sbin/ldconfig
%ldconfig_scriptlets cpp %post cpp -p /sbin/ldconfig
%postun cpp -p /sbin/ldconfig
%files %files
%doc README.md %doc README.md
%license COPYING %license COPYING
%{_libdir}/libpoppler.so.106* %{_libdir}/libpoppler.so.104*
%files devel %files devel
%{_libdir}/pkgconfig/poppler.pc %{_libdir}/pkgconfig/poppler.pc
%{_libdir}/pkgconfig/poppler-splash.pc
%{_libdir}/libpoppler.so %{_libdir}/libpoppler.so
%dir %{_includedir}/poppler/ %dir %{_includedir}/poppler/
# xpdf headers # xpdf headers
@ -217,6 +225,7 @@ test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%files glib-devel %files glib-devel
%{_libdir}/pkgconfig/poppler-glib.pc %{_libdir}/pkgconfig/poppler-glib.pc
%{_libdir}/pkgconfig/poppler-cairo.pc
%{_libdir}/libpoppler-glib.so %{_libdir}/libpoppler-glib.so
%{_datadir}/gir-1.0/Poppler-0.18.gir %{_datadir}/gir-1.0/Poppler-0.18.gir
%{_includedir}/poppler/glib/ %{_includedir}/poppler/glib/
@ -246,264 +255,182 @@ test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%{_mandir}/man1/* %{_mandir}/man1/*
%changelog %changelog
* Fri Jul 26 2024 Marek Kasik <mkasik@redhat.com> - 21.01.0-21 * Fri Jul 26 2024 Marek Kasik <mkasik@redhat.com> - 20.11.0-12
- Fix crash in broken documents when using -dests - Fix crash in broken documents when using -dests
- Resolves: RHEL-44333 - Fix versions in changelog
- Resolves: RHEL-44330
* Wed Apr 24 2024 Marek Kasik <mkasik@redhat.com> - 21.01.0-20 * Thu Oct 12 2023 Marek Kasik <mkasik@redhat.com> - 20.11.0-11
- Fix a crash during signing - Fix crashes in FoFiType1C
- Resolves: RHEL-31934
* Thu Oct 12 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-19
- Rebuild for inclusion of poppler-glib-doc in CRB - Rebuild for inclusion of poppler-glib-doc in CRB
- Resolves: RHEL-4274 - Resolves: RHEL-4255, RHEL-4273
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-18 * Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 20.11.0-10
- Check XRef's Catalog for being a Dict - Check XRef's Catalog for being a Dict
- Resolves: #2189820 - Resolves: #2189816
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-17 * Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 20.11.0-9
- Check isDict before calling getDict 2 - Check isDict before calling getDict 2
- Resolves: #2189841 - Resolves: #2189837
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-16 * Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 20.11.0-8
- Check isDict before calling getDict - Check isDict before calling getDict
- Resolves: #2189827 - Resolves: #2189823
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-15 * Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 20.11.0-7
- Don't crash in broken documents - Don't crash in broken documents
- Resolves: #2189848 - Resolves: #2189844
* Mon Sep 26 2022 Marek Kasik <mkasik@redhat.com> - 21.01.0-14 * Tue Sep 20 2022 Marek Kasik <mkasik@redhat.com> - 20.11.0-6
- Check for overflow when computing number of symbols - Check for overflow when computing number of symbols
- in JBIG2 text region - in JBIG2 text region
- Resolves: #2126364 - Resolves: #2126361
* Fri Jun 17 2022 Marek Kasik <mkasik@redhat.com> - 21.01.0-13 * Fri Jun 17 2022 Marek Kasik <mkasik@redhat.com> - 20.11.0-5
- Don't run out of file for Hints - Don't run out of file for Hints
- Rebuild for #2096451 - Rebuild for #2096452
- Resolves: #2090970, #2096451 - Resolves: #2090969, #2096452
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 21.01.0-12 * Thu Sep 9 2021 Marek Kasik <mkasik@redhat.com> - 20.11.0-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Fix opening files with streams with wrong generations
Related: rhbz#1991688 - Resolves: #2002575
* Thu Jun 17 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-11 * Wed Aug 4 2021 Marek Kasik <mkasik@redhat.com> - 20.11.0-3
- Backport fixes for issues found by Coverity Scan - Fix crash when processing dates of embedded files
- and fix some of the new issues - Resolves: #1981108
- Resolves: #1967967
* Mon Jun 14 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-10 * Tue Dec 8 2020 Marek Kasik <mkasik@redhat.com> - 20.11.0-2
- Fix showing of upper-case non-ASCII characters in annotations - Improve python3 build dependency
- Resolves: #1968289 - Resolves: #1896335
* Mon Jun 14 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-9 * Fri Nov 6 2020 Marek Kasik <mkasik@redhat.com> - 20.11.0-1
- Remove searchAcrossLines.pdf due to license - Rebase poppler to 20.11.0
- Resolves: #1967921 - Modify/remove patches as needed
- Resolves: #1644423
* Mon May 10 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-8 * Thu Apr 16 2020 Marek Kasik <mkasik@redhat.com> - 0.66.0-27
- Implement crypto functions using NSS - Fix crash on broken file in tilingPatternFill()
- Resolves: #1944726 - Resolves: #1801341
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 21.01.0-7 * Tue Aug 13 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-26
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - Coverity scan related fixes
- Related: #1618766
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 21.01.0-6 * Tue Aug 13 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-25
- Rebuilt for removed libstdc++ symbol (#1937698) - Check whether input is RGB in PSOutputDev::checkPageSlice()
- also when using "-optimizecolorspace" flag
- Resolves: #1697576
* Tue Feb 9 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-5 * Fri Aug 9 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-24
- Obsolete Qt4 frontend - Check whether input is RGB in PSOutputDev::checkPageSlice()
- Resolves: #1926010 - Resolves: #1697576
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 21.01.0-4 * Fri Aug 9 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Jan 15 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-3
- Improve the previous fix
- Resolves: #1915776
* Wed Jan 13 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-2
- Fix multilib property of poppler-glib
- by using the same build directory for all architectures
- Resolves: #1915776
* Mon Jan 11 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-1
- Update to 21.01.0
- Remove the Qt4 frontend
- Resolves: #1673727
* Mon Dec 07 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-8
- Build Qt4 frontend on Fedora only
* Sat Oct 31 2020 Jeff Law <law@redhat.com> - 0.90.0-7
- Fix bogus volatiles caught by gcc-11
* Tue Aug 04 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-6
- Align poppler with
- https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds
- Resolves: #1865248
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.90.0-5
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.90.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-3
- Fix some other issues.
- Resolves: #1673727
* Fri Jul 10 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-2
- Compile poppler with position independent code turned on.
- Otherwise it doesn't build on Fedora 33.
- Resolves: #1673727
* Wed Jul 08 2020 Marek Kasik <mkasik@redhat.com> - 0.90.0-1
- Update to 0.90.0
- Resolves: #1673727
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.84.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jan 17 2020 Marek Kasik <mkasik@redhat.com> - 0.84.0-1
- Update to 0.84.0
- Resolves: #1673727
* Fri Dec 20 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-15
- Check scaled dimensions for 0
- Resolves: #1785416
* Wed Jul 24 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-14
- Ignore dict Length if it is broken - Ignore dict Length if it is broken
- Resolves: #1732342 - Resolves: #1733027
* Thu May 30 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-13 * Fri Aug 9 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-22
- Don't read outside of image buffer in PSOutputDev
- Resolves: #1696640
* Thu May 30 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-12
- SplashXPathScanner::clipAALine: Fix crash on broken file
- Resolves: #1696640
* Thu May 30 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-11
- Restrict filling of overlapping boxes in Splash
- Resolves: #1696640
* Wed May 29 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-10
- Fail gracefully if not all components of JPEG2000Stream - Fail gracefully if not all components of JPEG2000Stream
- have the same size - have the same size
- Resolves: #1713585 - Resolves: #1723505
* Wed Apr 17 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-9 * Fri Jun 28 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-21
- Fix infinite loop in broken files - Implement crypto functions using NSS
- Resolves: #1699863 - Resolves: #1618766
* Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-8 * Wed Apr 3 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-20
- Fix stack overflow on broken file
- Resolves: #1691887
* Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-19
- Constrain number of cycles in rescale filter - Constrain number of cycles in rescale filter
- Compute correct coverage values for box filter - Compute correct coverage values for box filter
- Resolves: #1686803 - Resolves: #1688418
* Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-7 * Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-18
- Fix stack overflow on broken file
- Resolves: #1691725
* Mon Mar 11 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-6
- Fix possible crash on broken files in ImageStream::getLine() - Fix possible crash on broken files in ImageStream::getLine()
- Resolves: #1683633 - Resolves: #1685268
* Fri Mar 8 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-5 * Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-17
- Synchronize previous patch with upstream
- Related: #1665274
* Wed Feb 20 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-4
- Check Catalog from XRef for being a Dict - Check Catalog from XRef for being a Dict
- Resolves: #1665274 - Resolves: #1677347
* Wed Feb 20 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-3 * Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-16
- Move the fileSpec.dictLookup call inside fileSpec.isDict if
- Resolves: #1677028
* Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-15
- Do not try to construct invalid rich media annotation assets
- Resolves: #1677025
* Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-14
- Defend against requests for negative XRef indices - Defend against requests for negative XRef indices
- Resolves: #1672420 - Resolves: #1673699
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.73.0-2 * Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Do not try to parse into unallocated XRef entry
- Resolves: #1677057
* Fri Jan 25 2019 Marek Kasik <mkasik@redhat.com> - 0.73.0-1 * Mon Apr 1 2019 Marek Kasik <mkasik@redhat.com> - 0.66.0-12
- Update to 0.73.0
* Tue Jan 22 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-10
- Avoid global display profile state becoming an uncontrolled - Avoid global display profile state becoming an uncontrolled
- memory leak - memory leak
- Resolves: #1646549 - Resolves: #1646552
* Mon Jan 21 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-9 * Fri Dec 14 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-11
- Do not try to parse into unallocated XRef entry - Fix tiling patterns when pattern cell is too far
- Resolves: #1665268 - Resolves: #1644094
* Mon Jan 21 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-8 * Fri Nov 16 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-10
- Move the fileSpec.dictLookup call inside fileSpec.isDict if
- Resolves: #1665264
* Mon Jan 21 2019 Marek Kasik <mkasik@redhat.com> - 0.67.0-7
- Do not try to construct invalid rich media annotation assets
- Resolves: #1665260
* Thu Nov 15 2018 Marek Kasik <mkasik@redhat.com> - 0.67.0-6
- Check for valid file name of embedded file - Check for valid file name of embedded file
- Resolves: #1649451 - Resolves: #1649453
* Thu Nov 15 2018 Marek Kasik <mkasik@redhat.com> - 0.67.0-5 * Fri Nov 16 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-9
- Check for valid embedded file before trying to save it - Check for valid embedded file before trying to save it
- Resolves: #1649441 - Resolves: #1649443
* Thu Nov 15 2018 Marek Kasik <mkasik@redhat.com> - 0.67.0-4 * Fri Nov 16 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-8
- Check for stream before calling stream methods - Check for stream before calling stream methods
- when saving an embedded file - when saving an embedded file
- Resolves: #1649436 - Resolves: #1649438
* Mon Nov 12 2018 Marek Kasik <mkasik@redhat.com> - 0.67.0-3 * Thu Nov 15 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-7
- Avoid cycles in PDF parsing
- Resolves: #1626620
* Wed Oct 17 2018 Marek Kasik <mkasik@redhat.com> - 0.67.0-2
- Fix crash on missing embedded file - Fix crash on missing embedded file
- Resolves: #1569334 - Resolves: #1649460
* Tue Aug 14 2018 Marek Kasik <mkasik@redhat.com> - 0.67.0-1 * Thu Nov 15 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-6
- Update to 0.67.0 - Avoid cycles in PDF parsing
- Resolves: #1568641 - Resolves: #1626623
* Tue Aug 7 2018 Marek Kasik <mkasik@redhat.com> - 0.63.0-8 * Fri Oct 12 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-5
- Fix tiling patterns when pattern cell is too far - Fix crash when accessing list of selections
- Resolves: #1557355 - Resolves: #1638712
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 0.63.0-7 * Mon Sep 24 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-4
- Rebuild with fixed binutils - Fix important issues found by covscan
- Resolves: #1602662
* Fri Jul 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.63.0-6 * Tue Aug 14 2018 Petr Viktorin <pviktori@redhat.com> - 0.66.0-3
- Rebuild for new binutils - Fix BuildRequires for /usr/bin/python3
- Resolves: #1615561
* Thu Jul 26 2018 Marek Kasik <mkasik@redhat.com> - 0.63.0-5 * Thu Jul 26 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-2
- Fix crash when Object has negative number (CVE-2018-13988) - Fix crash when Object has negative number (CVE-2018-13988)
- Resolves: #1607461 - Resolves: #1607463
* Mon Jul 23 2018 Marek Kasik <mkasik@redhat.com> - 0.63.0-4 * Thu Jul 12 2018 Marek Kasik <mkasik@redhat.com> - 0.66.0-1
- Use /usr/bin/python3 explicitly - Rebase poppler to 0.66.0
- https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3#Transition_Steps - Resolves: #1600553
- Resolves: #1605490
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.63.0-3 * Mon Jun 11 2018 Marek Kasik <mkasik@redhat.com> - 0.62.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Drop reversion of removal of Qt4 frontend
* Mon May 28 2018 Marek Kasik <mkasik@redhat.com> - 0.63.0-2 * Fri May 25 2018 Marek Kasik <mkasik@redhat.com> - 0.62.0-3
- Fix infinite recursion (CVE-2017-18267) - Fix infinite recursion (CVE-2017-18267)
- Resolves: #1578780 - Resolves: #1578779
* Fri Mar 23 2018 Marek Kasik <mkasik@redhat.com> - 0.63.0-1 * Thu May 24 2018 Marek Kasik <mkasik@redhat.com> - 0.62.0-2
- Update to 0.63.0 - Fix building of poppler with python3 only
- Resolves: #1558001 - Resolves: #1580849
* Wed Mar 07 2018 Rex Dieter <rdieter@fedoraproject.org> - 0.62.0-2
- BR: gcc-c++, use %%ldconfig_scriptlets %%make_build %%make_install
* Wed Feb 14 2018 David Tardon <dtardon@redhat.com> - 0.62.0-1 * Wed Feb 14 2018 David Tardon <dtardon@redhat.com> - 0.62.0-1
- new upstream release - new upstream release

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: desktop-qe.desktop-ci.tier1-gating.functional}

View File

@ -1,12 +0,0 @@
--- poppler-0.90.0/CMakeLists.txt
+++ poppler-0.90.0/CMakeLists.txt
@@ -17,6 +17,9 @@ else()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
endif()
+
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
include(CheckFileOffsetBits)

View File

@ -1,11 +0,0 @@
--- poppler-21.01.0/poppler/Form.cc
+++ poppler-21.01.0/poppler/Form.cc
@@ -603,7 +603,7 @@ bool FormWidgetSignature::signDocument(c
// Get start and end file position of objNum in the PDF named filename.
bool FormWidgetSignature::getObjectStartEnd(GooString *filename, int objNum, Goffset *objStart, Goffset *objEnd)
{
- PDFDoc newDoc(filename);
+ PDFDoc newDoc(filename->copy());
if (!newDoc.isOk())
return false;

View File

@ -1,439 +0,0 @@
--- poppler/glib/poppler-document.cc
+++ poppler/glib/poppler-document.cc
@@ -869,12 +869,12 @@ GTree *poppler_document_create_dests_tre
// Iterate from name-dict
const int nDests = catalog->numDests();
for (i = 0; i < nDests; ++i) {
- // The names of name-dict cannot contain \0,
- // so we can use strlen().
- auto name = catalog->getDestsName(i);
- key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name), strlen(name));
std::unique_ptr<LinkDest> link_dest = catalog->getDestsDest(i);
if (link_dest) {
+ // The names of name-dict cannot contain \0,
+ // so we can use strlen().
+ auto name = catalog->getDestsName(i);
+ key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name), strlen(name));
dest = _poppler_dest_new_goto(document, link_dest.get());
g_tree_insert(tree, key, dest);
}
@@ -883,10 +883,10 @@ GTree *poppler_document_create_dests_tre
// Iterate form name-tree
const int nDestsNameTree = catalog->numDestNameTree();
for (i = 0; i < nDestsNameTree; ++i) {
- auto name = catalog->getDestNameTreeName(i);
- key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name->c_str()), name->getLength());
std::unique_ptr<LinkDest> link_dest = catalog->getDestNameTreeDest(i);
if (link_dest) {
+ auto name = catalog->getDestNameTreeName(i);
+ key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name->c_str()), name->getLength());
dest = _poppler_dest_new_goto(document, link_dest.get());
g_tree_insert(tree, key, dest);
}
@@ -3405,6 +3405,7 @@ PopplerFormField *poppler_document_get_f
unsigned fieldNum;
FormPageWidgets *widgets;
FormWidget *field;
+ PopplerFormField *formField;
FormWidget::decodeID(id, &pageNum, &fieldNum);
@@ -3417,8 +3418,14 @@ PopplerFormField *poppler_document_get_f
return nullptr;
field = widgets->getWidget(fieldNum);
- if (field)
- return _poppler_form_field_new(document, field);
+ if (field) {
+ formField = _poppler_form_field_new(document, field);
+ delete widgets;
+
+ return formField;
+ }
+
+ delete widgets;
return nullptr;
}
--- poppler-21.01.0/glib/poppler-page.cc
+++ poppler-21.01.0/glib/poppler-page.cc
@@ -1530,15 +1530,18 @@ void poppler_page_add_annot(PopplerPage
* first remove cropbox of the prior page before adding cropbox of the new page later */
quads = new_quads_from_offset_cropbox(crop_box, annot_markup->getQuadrilaterals(), FALSE);
annot_markup->setQuadrilaterals(quads);
+ delete quads;
}
if (page_is_rotated) {
/* Quadrilateral's coords need to be saved un-rotated (same as rect coords) */
quads = _page_new_quads_unrotated(page->page, annot_markup->getQuadrilaterals());
annot_markup->setQuadrilaterals(quads);
+ delete quads;
}
/* Add to annot's quadrilaterals the offset for the cropbox of the new page */
quads = new_quads_from_offset_cropbox(page_crop_box, annot_markup->getQuadrilaterals(), TRUE);
annot_markup->setQuadrilaterals(quads);
+ delete quads;
}
page->page->addAnnot(annot->annot);
--- poppler-21.01.0/glib/poppler-structure-element.cc
+++ poppler-21.01.0/glib/poppler-structure-element.cc
@@ -1090,6 +1090,8 @@ static inline void convert_doubles_array
for (guint i = 0; i < *n_values; i++) {
doubles[i] = object->arrayGet(i).getNum();
}
+
+ values = &doubles;
}
static inline void convert_color(Object *object, PopplerColor *color)
--- poppler-21.01.0/poppler/Form.cc
+++ poppler-21.01.0/poppler/Form.cc
@@ -549,6 +549,7 @@ bool FormWidgetSignature::signDocument(c
GooString *fname = new GooString(saveFilename);
if (doc->saveAs(fname, writeForceIncremental) != errNone) {
fprintf(stderr, "signDocument: error saving to file \"%s\"\n", saveFilename);
+ delete fname;
return false;
}
@@ -563,6 +564,8 @@ bool FormWidgetSignature::signDocument(c
FILE *file = openFile(saveFilename, "r+b");
if (!updateOffsets(file, objStart, objEnd, &sigStart, &sigEnd, &fileSize)) {
fprintf(stderr, "signDocument: unable update byte range\n");
+ delete fname;
+ fclose(file);
return false;
}
@@ -574,15 +577,21 @@ bool FormWidgetSignature::signDocument(c
// and sign it
const std::unique_ptr<GooString> signature = sigHandler.signDetached(password);
- if (!signature)
+ if (!signature) {
+ delete fname;
+ fclose(file);
return false;
+ }
// write signature to saved file
if (!updateSignature(file, sigStart, sigEnd, signature.get())) {
fprintf(stderr, "signDocument: unable update signature\n");
+ delete fname;
+ fclose(file);
return false;
}
signatureField->setSignature(*signature);
+ delete fname;
fclose(file);
return true;
@@ -662,22 +670,30 @@ bool FormWidgetSignature::updateOffsets(
}
}
- if (*sigStart == -1 || *sigEnd == -1)
+ if (*sigStart == -1 || *sigEnd == -1) {
+ free(buf);
return false;
+ }
// Search for ByteRange array and update offsets
for (int i = 0; i < bufSize - 10; i++) {
if (buf[i] == '/' && strncmp(&buf[i], "/ByteRange", 10) == 0) {
// update range
char *p = setNextOffset(&buf[i], *sigStart);
- if (!p)
+ if (!p) {
+ free(buf);
return false;
+ }
p = setNextOffset(p, *sigEnd);
- if (!p)
+ if (!p) {
+ free(buf);
return false;
+ }
p = setNextOffset(p, *fileSize - *sigEnd);
- if (!p)
+ if (!p) {
+ free(buf);
return false;
+ }
break;
}
}
--- poppler-21.01.0/poppler/JBIG2Stream.cc
+++ poppler-21.01.0/poppler/JBIG2Stream.cc
@@ -2834,6 +2834,8 @@ JBIG2Bitmap *JBIG2Stream::readGenericBit
if (unlikely(!codingLine || !refLine)) {
error(errSyntaxError, curStr->getPos(), "Bad width in JBIG2 generic bitmap");
+ gfree(refLine);
+ gfree(codingLine);
delete bitmap;
return nullptr;
}
--- poppler-21.01.0/poppler/Lexer.cc
+++ poppler-21.01.0/poppler/Lexer.cc
@@ -461,6 +461,7 @@ Object Lexer::getObj(int objNum)
} else if (n == tokBufSize) {
error(errSyntaxError, getPos(), "Warning: name token is longer than what the specification says it can be");
*p = c;
+ delete s;
s = new GooString(tokBuf, n);
} else {
s->append((char)c);
@@ -468,6 +468,7 @@ Object Lexer::getObj(int objNum)
}
if (n < tokBufSize) {
*p = '\0';
+ delete s;
return Object(objName, tokBuf);
} else {
Object obj(objName, s->c_str());
--- poppler/poppler/CairoOutputDev.cc
+++ poppler/poppler/CairoOutputDev.cc
@@ -2921,8 +2921,10 @@ void CairoOutputDev::setMimeData(GfxStat
// colorspace in stream dict may be different from colorspace in jpx
// data
- if (strKind == strJPX && colorSpace)
+ if (strKind == strJPX && colorSpace) {
+ delete colorSpace;
return;
+ }
// only embed mime data for gray, rgb, and cmyk colorspaces.
if (colorSpace) {
--- poppler/poppler/TextOutputDev.cc
+++ poppler/poppler/TextOutputDev.cc
@@ -20,7 +20,7 @@
// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007, 2008, 2012, 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
-// Copyright (C) 2008, 2010-2012, 2014-2020 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008, 2010-2012, 2014-2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2008, 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2009 Ross Moore <ross@maths.mq.edu.au>
@@ -1619,7 +1619,6 @@ TextBlock::~TextBlock()
void TextBlock::addWord(TextWord *word)
{
- pool->addWord(word);
if (xMin > xMax) {
xMin = word->xMin;
xMax = word->xMax;
@@ -1639,6 +1638,7 @@ void TextBlock::addWord(TextWord *word)
yMax = word->yMax;
}
}
+ pool->addWord(word);
}
void TextBlock::coalesce(const UnicodeMap *uMap, double fixedPitch)
@@ -3064,11 +3064,13 @@ void TextPage::coalesce(bool physLayout,
word0 = pool->getPool(startBaseIdx);
pool->setPool(startBaseIdx, word0->next);
word0->next = nullptr;
- blk = new TextBlock(this, rot);
- blk->addWord(word0);
fontSize = word0->fontSize;
minBase = maxBase = word0->base;
+
+ blk = new TextBlock(this, rot);
+ blk->addWord(word0);
+
colSpace1 = minColSpacing1 * fontSize;
colSpace2 = minColSpacing2 * fontSize;
lineSpace = maxLineSpacingDelta * fontSize;
@@ -3095,9 +3097,9 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
+ newMinBase = word2->base;
blk->addWord(word2);
found = true;
- newMinBase = word2->base;
} else {
word0 = word1;
word1 = word1->next;
@@ -3123,9 +3125,9 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
+ newMaxBase = word2->base;
blk->addWord(word2);
found = true;
- newMaxBase = word2->base;
} else {
word0 = word1;
word1 = word1->next;
@@ -3198,12 +3200,12 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
- blk->addWord(word2);
if (word2->base < minBase) {
minBase = word2->base;
} else if (word2->base > maxBase) {
maxBase = word2->base;
}
+ blk->addWord(word2);
found = true;
break;
} else {
@@ -3246,12 +3248,12 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
- blk->addWord(word2);
if (word2->base < minBase) {
minBase = word2->base;
} else if (word2->base > maxBase) {
maxBase = word2->base;
}
+ blk->addWord(word2);
found = true;
break;
} else {
@@ -4456,13 +4456,18 @@ class TextSelectionSizer : public TextSe
{
public:
TextSelectionSizer(TextPage *page, double scale);
- ~TextSelectionSizer() override { }
+ ~TextSelectionSizer() override { delete list; }
void visitBlock(TextBlock *block, TextLine *begin, TextLine *end, const PDFRectangle *selection) override {};
void visitLine(TextLine *line, TextWord *begin, TextWord *end, int edge_begin, int edge_end, const PDFRectangle *selection) override;
void visitWord(TextWord *word, int begin, int end, const PDFRectangle *selection) override {};
- std::vector<PDFRectangle *> *getRegion() { return list; }
+ std::vector<PDFRectangle *> *takeRegion()
+ {
+ auto aux = list;
+ list = nullptr;
+ return aux;
+ }
private:
std::vector<PDFRectangle *> *list;
@@ -5063,7 +5068,7 @@ std::vector<PDFRectangle *> *TextPage::g
visitSelection(&sizer, selection, style);
- return sizer.getRegion();
+ return sizer.takeRegion();
}
GooString *TextPage::getSelectionText(const PDFRectangle *selection, SelectionStyle style)
--- poppler/poppler/XRef.cc
+++ poppler/poppler/XRef.cc
@@ -402,6 +402,7 @@ int XRef::reserve(int newSize)
void *p = greallocn_checkoverflow(entries, realNewSize, sizeof(XRefEntry));
if (p == nullptr) {
+ entries = nullptr;
return 0;
}
@@ -835,7 +836,6 @@ bool XRef::constructXRef(bool *wasRecons
int offset = 0;
resize(0); // free entries properly
- gfree(entries);
capacity = 0;
size = 0;
entries = nullptr;
--- poppler/test/pdf-inspector.cc
+++ poppler/test/pdf-inspector.cc
@@ -43,6 +43,7 @@ class PdfInspector
{
public:
PdfInspector();
+ ~PdfInspector();
void set_file_name(const char *file_name);
void load(const char *file_name);
@@ -108,6 +109,11 @@ PdfInspector::PdfInspector()
load(nullptr);
}
+PdfInspector::~PdfInspector(void)
+{
+ delete output;
+}
+
void PdfInspector::set_file_name(const char *file_name)
{
GtkWidget *widget;
--- poppler/utils/HtmlOutputDev.cc
+++ poppler/utils/HtmlOutputDev.cc
@@ -1337,6 +1337,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
// TODO can we calculate the resolution of the image?
if (!writer->init(f1, width, height, 72, 72)) {
error(errInternal, -1, "Can't init PNG for image '{0:t}'", fName);
+ delete fName;
delete writer;
fclose(f1);
return;
@@ -1378,6 +1378,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
if (!writer->writeRow(row_pointer)) {
error(errIO, -1, "Failed to write into PNG '{0:t}'", fName);
+ delete fName;
delete writer;
delete imgStr;
fclose(f1);
@@ -1413,6 +1414,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
if (!writer->writeRow(&png_row)) {
error(errIO, -1, "Failed to write into PNG '{0:t}'", fName);
+ delete fName;
delete writer;
fclose(f1);
gfree(png_row);
--- poppler/utils/pdftotext.cc
+++ poppler/utils/pdftotext.cc
@@ -329,6 +329,7 @@ int main(int argc, char *argv[])
fputs("<pre>\n", f);
if (f != stdout) {
fclose(f);
+ f = nullptr;
}
}
}
@@ -348,8 +349,9 @@ int main(int argc, char *argv[])
printWordBBox(f, doc, textOut, firstPage, lastPage);
}
}
- if (f != stdout) {
+ if (f != stdout && f != nullptr) {
fclose(f);
+ f = nullptr;
}
} else {
textOut = new TextOutputDev(textFileName->c_str(), physLayout, fixedPitch, rawOrder, htmlMeta, discardDiag);
@@ -390,7 +392,7 @@ int main(int argc, char *argv[])
fputs("</pre>\n", f);
fputs("</body>\n", f);
fputs("</html>\n", f);
- if (f != stdout) {
+ if (f != stdout && f != nullptr) {
fclose(f);
}
}
@@ -533,7 +533,9 @@ void printWordBBox(FILE *f, PDFDoc *doc,
for (int i = 0; i < word_length; ++i) {
word = wordlist->get(i);
word->getBBox(&xMinA, &yMinA, &xMaxA, &yMaxA);
- const std::string myString = myXmlTokenReplace(word->getText()->c_str());
+ GooString *wordText = word->getText();
+ const std::string myString = myXmlTokenReplace(wordText->c_str());
+ delete wordText;
fprintf(f, " <word xMin=\"%f\" yMin=\"%f\" xMax=\"%f\" yMax=\"%f\">%s</word>\n", xMinA, yMinA, xMaxA, yMaxA, myString.c_str());
}
fprintf(f, " </page>\n");

View File

@ -1,11 +0,0 @@
--- poppler-21.01.0/glib/CMakeLists.txt
+++ poppler-21.01.0/glib/CMakeLists.txt
@@ -121,7 +121,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_
# General gir: Reset object-list for introspection & load tool args
set(INTROSPECTION_GIRS)
- set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all")
+ set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all" "--sources-top-dirs=${CMAKE_SOURCE_DIR}" "--sources-top-dirs=${CMAKE_BINARY_DIR}")
set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
# Poppler: Assign package to gir & export keys

View File

@ -1,28 +0,0 @@
From 5dbe101b7c3561aedf33872e218b8d1b6984f623 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Sat, 8 May 2021 00:54:13 +0200
Subject: [PATCH] Restore setting the Encoding in createAnnotDrawFont
It was removed in 9db685f379c1c9195b5f0c9a693e7a581e6b214f and as far as
i remember the reason was that signatures created with that hung Adobe
Reader, but I can't reproduce it anymore and on top of that is causing
regressions when rendering PDF files (Issue #1070) so restore it.
---
poppler/Annot.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 5287b4dc..40b1085a 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -2852,6 +2852,7 @@ static GfxFont *createAnnotDrawFont(XRef *xref, Dict *fontParentDict, const char
Dict *fontDict = new Dict(xref);
fontDict->add("BaseFont", Object(objName, fontname));
fontDict->add("Subtype", Object(objName, "Type1"));
+ fontDict->add("Encoding", Object(objName, "WinAnsiEncoding"));
Object fontsDictObj = fontParentDict->lookup("Font");
if (!fontsDictObj.isDict()) {
--
2.31.1

View File

@ -1,27 +0,0 @@
diff --git a/glib/poppler-enums.c.template b/glib/poppler-enums.c.template
index 26a51b4..27be2b9 100644
--- a/glib/poppler-enums.c.template
+++ b/glib/poppler-enums.c.template
@@ -15,7 +15,7 @@
GType
@enum_name@_get_type (void)
{
- static volatile gsize g_define_type_id__volatile = 0;
+ static gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile)) {
static const G@Type@Value values[] = {
diff --git a/glib/poppler-private.h b/glib/poppler-private.h
index 7726ec7..436bca5 100644
--- a/glib/poppler-private.h
+++ b/glib/poppler-private.h
@@ -167,7 +167,7 @@ gboolean _poppler_convert_pdf_date_to_gtime (const GooString *date,
#define POPPLER_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \
GType type_name##_get_type(void) \
{ \
- static volatile gsize g_define_type_id__volatile = 0; \
+ static gsize g_define_type_id__volatile = 0; \
if (g_once_init_enter(&g_define_type_id__volatile)) { \
GType g_define_type_id = g_boxed_type_register_static(g_intern_static_string(#TypeName), (GBoxedCopyFunc)copy_func, (GBoxedFreeFunc)free_func); \
g_once_init_leave(&g_define_type_id__volatile, g_define_type_id); \

View File

@ -1,2 +0,0 @@
SHA512 (poppler-test-2021-06-14.tar.xz) = 353255b36806ab6a4414f0a6c2cfa0e416af8909bf6a3e7a83380287ca0519d2b92d6f88c46297ed32f7a8f68686571d61c1bc39a4e459d9143bad76e1bea4a2
SHA512 (poppler-21.01.0.tar.xz) = aec130446df73a2fc66851a563a14cb40299212a2de4a0d03668b0fecb28312fffa70d0a82431c774d0c0e3f7293788bd2bdf28c8136aa09ad80edbca4cf0ddd