Update to 23.02.0

Resolves: #2123190
This commit is contained in:
Marek Kasik 2023-02-03 22:49:37 +01:00
parent d227d79b32
commit 02e6b36e35
6 changed files with 9 additions and 174 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@
/poppler-21.08.0.tar.xz
/poppler-22.01.0.tar.xz
/poppler-22.08.0.tar.xz
/poppler-23.02.0.tar.xz

View File

@ -1,26 +0,0 @@
From 27354e9d9696ee2bc063910a6c9a6b27c5184a52 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Thu, 25 Aug 2022 00:14:22 +0200
Subject: JBIG2Stream: Fix crash on broken file
https://github.com/jeffssh/CVE-2021-30860
Thanks to David Warren for the heads up
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 662276e5..9f70431d 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1976,7 +1976,11 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm, bool lossless
for (i = 0; i < nRefSegs; ++i) {
if ((seg = findSegment(refSegs[i]))) {
if (seg->getType() == jbig2SegSymbolDict) {
- numSyms += ((JBIG2SymbolDict *)seg)->getSize();
+ const unsigned int segSize = ((JBIG2SymbolDict *)seg)->getSize();
+ if (unlikely(checkedAdd(numSyms, segSize, &numSyms))) {
+ error(errSyntaxError, getPos(), "Too many symbols in JBIG2 text region");
+ return;
+ }
} else if (seg->getType() == jbig2SegCodeTable) {
codeTables.push_back(seg);
}

View File

@ -1,44 +0,0 @@
From bc4a0d9a2abfcd75d9b0ee4be3f7600905fe6001 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Fri, 24 Jun 2022 22:01:27 +0200
Subject: [PATCH 2/2] Form: Provide Unicode marker when ensuring fonts
Form::ensureFontsForAllCharacters() needs input text with Unicode marker.
Provide such in FormFieldText::setContentCopy().
---
poppler/Form.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/poppler/Form.cc b/poppler/Form.cc
index d33160b3..9407b6c5 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -27,7 +27,7 @@
// Copyright 2019, 2020 Oliver Sander <oliver.sander@tu-dresden.de>
// Copyright 2019 Tomoyuki Kubota <himajin100000@gmail.com>
// Copyright 2019 João Netto <joaonetto901@gmail.com>
-// Copyright 2020, 2021 Marek Kasik <mkasik@redhat.com>
+// Copyright 2020-2022 Marek Kasik <mkasik@redhat.com>
// Copyright 2020 Thorsten Behrens <Thorsten.Behrens@CIB.de>
// Copyright 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
// Copyright 2021 Georgiy Sgibnev <georgiy@sgibnev.com>. Work sponsored by lab50.net.
@@ -1674,14 +1674,14 @@ void FormFieldText::setContentCopy(const GooString *new_content)
Object fieldResourcesDictObj = obj.dictLookup("DR");
if (fieldResourcesDictObj.isDict()) {
GfxResources fieldResources(doc->getXRef(), fieldResourcesDictObj.getDict(), form->getDefaultResources());
- const std::vector<Form::AddFontResult> newFonts = form->ensureFontsForAllCharacters(new_content, fontName, &fieldResources);
+ const std::vector<Form::AddFontResult> newFonts = form->ensureFontsForAllCharacters(content, fontName, &fieldResources);
// If we added new fonts to the Form object default resuources we also need to add them (we only add the ref so this is cheap)
// to the field DR dictionary
for (const Form::AddFontResult &afr : newFonts) {
fieldResourcesDictObj.dictLookup("Font").dictAdd(afr.fontName.c_str(), Object(afr.ref));
}
} else {
- form->ensureFontsForAllCharacters(new_content, fontName);
+ form->ensureFontsForAllCharacters(content, fontName);
}
}
} else {
--
2.38.1

View File

@ -1,94 +0,0 @@
From 111f38a722eedddd94faa52dda8c5e0da561fb41 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Fri, 24 Jun 2022 22:00:09 +0200
Subject: [PATCH 1/2] Cairo: Update font after restore
Update font after restore (Q operator) if font has changed.
This is important when entering text into forms if there
are characters shown by default font after characters
which needed new font.
New method getRef() where added to CairoFont class to
be able to easily compare fonts.
---
poppler/CairoFontEngine.h | 3 +++
poppler/CairoOutputDev.cc | 7 ++++++-
poppler/CairoOutputDev.h | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/poppler/CairoFontEngine.h b/poppler/CairoFontEngine.h
index 56cc8825..c97e0ea4 100644
--- a/poppler/CairoFontEngine.h
+++ b/poppler/CairoFontEngine.h
@@ -22,6 +22,7 @@
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2018 Adam Reichold <adam.reichold@t-online.de>
// Copyright (C) 2022 Oliver Sander <oliver.sander@tu-dresden.de>
+// Copyright (C) 2022 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
@@ -59,6 +60,8 @@ public:
bool isSubstitute() { return substitute; }
+ Ref getRef() { return ref; }
+
protected:
Ref ref;
cairo_font_face_t *cairo_font_face;
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index b402cc8b..a72c218a 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -31,7 +31,7 @@
// Copyright (C) 2015 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
// Copyright (C) 2018, 2020 Adam Reichold <adam.reichold@t-online.de>
-// Copyright (C) 2019, 2020 Marek Kasik <mkasik@redhat.com>
+// Copyright (C) 2019, 2020, 2022 Marek Kasik <mkasik@redhat.com>
// Copyright (C) 2020 Michal <sudolskym@gmail.com>
// Copyright (C) 2020, 2022 Oliver Sander <oliver.sander@tu-dresden.de>
// Copyright (C) 2021 Uli Schlachter <psychon@znc.in>
@@ -357,6 +357,7 @@ void CairoOutputDev::saveState(GfxState *state)
elem.stroke_opacity = stroke_opacity;
elem.mask = mask ? cairo_pattern_reference(mask) : nullptr;
elem.mask_matrix = mask_matrix;
+ elem.fontRef = currentFont ? currentFont->getRef() : Ref::INVALID();
saveStateStack.push_back(elem);
if (strokePathClip) {
@@ -384,6 +385,10 @@ void CairoOutputDev::restoreState(GfxState *state)
stroke_color = {};
stroke_opacity = saveStateStack.back().stroke_opacity;
+ if (saveStateStack.back().fontRef != (currentFont ? currentFont->getRef() : Ref::INVALID())) {
+ needFontUpdate = true;
+ }
+
/* This isn't restored by cairo_restore() since we keep it in the
* output device. */
updateBlendMode(state);
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index c287bf5c..5ce877d2 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -27,6 +27,7 @@
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
// Copyright (C) 2020 Michal <sudolskym@gmail.com>
// Copyright (C) 2021 Christian Persch <chpe@src.gnome.org>
+// Copyright (C) 2022 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
@@ -381,6 +382,7 @@ protected:
double stroke_opacity;
cairo_pattern_t *mask; // can be null
cairo_matrix_t mask_matrix;
+ Ref fontRef;
};
std::vector<SaveStateElement> saveStateStack;
};
--
2.38.1

View File

@ -14,8 +14,8 @@
Summary: PDF rendering library
Name: poppler
Version: 22.08.0
Release: 5%{?dist}
Version: 23.02.0
Release: 1%{?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
@ -26,12 +26,6 @@ Patch1: poppler-0.90.0-position-independent-code.patch
Patch3: poppler-21.01.0-glib-introspection.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2124527
Patch4: poppler-22.08.0-jbig-symbol-overflow.patch
Patch5: poppler-22.08.0-update-font-after-restore.patch
Patch6: poppler-22.08.0-provide-unicode-marker.patch
BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc-c++
@ -223,7 +217,7 @@ test "$(pkg-config --modversion poppler-qt6)" = "%{version}"
%files
%doc README.md
%license COPYING
%{_libdir}/libpoppler.so.123*
%{_libdir}/libpoppler.so.126*
%files devel
%{_libdir}/pkgconfig/poppler.pc
@ -282,6 +276,10 @@ test "$(pkg-config --modversion poppler-qt6)" = "%{version}"
%{_mandir}/man1/*
%changelog
* Fri Feb 3 2023 Marek Kasik <mkasik@redhat.com> - 23.02.0-1
- Update to 23.02.0
- Resolves: #2123190
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 22.08.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

View File

@ -1,2 +1,2 @@
SHA512 (poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz) = 257133b261b07076d3207456e3edad324e29911a45a960d4953eb84813ac175bc65be713a10454b52b96711870fcbeee533fd0fd7de8550a87390e833b1af8c5
SHA512 (poppler-22.08.0.tar.xz) = bbff6d51eaafe58891357069c83e43ea25b4077755fa715a17b38660cd3cd546fa21d2e17a272d9b375f7e440e6e3661e84a20f18d445e0f28d06971abc04666
SHA512 (poppler-23.02.0.tar.xz) = 0765319a1b106da740c7300172866e774ccbeec0bc0e938f009efd1a106b35ca2e5ab60a523e1d1dd5682b30499de4dffed0a1ca129c770263a096f781337a2c