From 5ecd9a1b9ec4f8cbaf8775038f07a1ad233c5937 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 9 Nov 2021 04:46:10 -0500 Subject: [PATCH] import poppler-20.11.0-3.el8 --- SOURCES/poppler-20.11.0-bad-generation.patch | 35 ------------------- SOURCES/poppler-20.11.0-check-gdatetime.patch | 30 ++++++++++++++++ SPECS/poppler.spec | 12 +++---- 3 files changed, 36 insertions(+), 41 deletions(-) delete mode 100644 SOURCES/poppler-20.11.0-bad-generation.patch create mode 100644 SOURCES/poppler-20.11.0-check-gdatetime.patch diff --git a/SOURCES/poppler-20.11.0-bad-generation.patch b/SOURCES/poppler-20.11.0-bad-generation.patch deleted file mode 100644 index e4a0c1a..0000000 --- a/SOURCES/poppler-20.11.0-bad-generation.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4f478daa6a9734b8f269a6586bdce2909844bb6f Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -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 - #include - #include -+#include - #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::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) { diff --git a/SOURCES/poppler-20.11.0-check-gdatetime.patch b/SOURCES/poppler-20.11.0-check-gdatetime.patch new file mode 100644 index 0000000..2b9c457 --- /dev/null +++ b/SOURCES/poppler-20.11.0-check-gdatetime.patch @@ -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 + } + diff --git a/SPECS/poppler.spec b/SPECS/poppler.spec index ab189be..3d5af89 100644 --- a/SPECS/poppler.spec +++ b/SPECS/poppler.spec @@ -4,7 +4,7 @@ Summary: PDF rendering library Name: poppler Version: 20.11.0 -Release: 2%{?dist}.1 +Release: 3%{?dist} License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz @@ -21,8 +21,8 @@ Patch4: poppler-0.66.0-covscan.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1618766 Patch21: poppler-0.66.0-nss.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=2002638 -Patch22: poppler-20.11.0-bad-generation.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1981108 +Patch22: poppler-20.11.0-check-gdatetime.patch BuildRequires: cmake BuildRequires: gettext-devel @@ -228,9 +228,9 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_mandir}/man1/* %changelog -* Thu Sep 9 2021 Marek Kasik - 20.11.0-2.el8_4.1 -- Fix opening files with streams with wrong generations -- Resolves: #2002638 +* Wed Aug 4 2021 Marek Kasik - 20.11.0-3 +- Fix crash when processing dates of embedded files +- Resolves: #1981108 * Tue Dec 8 2020 Marek Kasik - 20.11.0-2 - Improve python3 build dependency