poppler: Upgrade to 24.09.0 release

Drop backported patches

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2024-09-05 20:33:09 -07:00
parent 4a86f8a54f
commit fb7e45fcbf
6 changed files with 17 additions and 1504 deletions
@@ -40,11 +40,9 @@ Upstream-Status: Pending
utils/CMakeLists.txt | 10 +++++----- utils/CMakeLists.txt | 10 +++++-----
6 files changed, 16 insertions(+), 16 deletions(-) 6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6c757c..5f1c540 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -603,10 +603,10 @@ add_library(poppler ${poppler_SRCS}) @@ -628,10 +628,10 @@ add_library(poppler ${poppler_SRCS} ${LI
if (OpenJPEG_FOUND) if (OpenJPEG_FOUND)
# check if we can remove this when we depend on newer openjpeg versions, 2.5 seems fixed # check if we can remove this when we depend on newer openjpeg versions, 2.5 seems fixed
# target openjp2 may lack interface include directories # target openjp2 may lack interface include directories
@@ -56,9 +54,7 @@ index c6c757c..5f1c540 100644
+ target_include_directories(poppler PRIVATE ${LCMS2_INCLUDE_DIR}) + target_include_directories(poppler PRIVATE ${LCMS2_INCLUDE_DIR})
endif() endif()
generate_export_header(poppler BASE_NAME poppler-private EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/poppler_private_export.h") generate_export_header(poppler BASE_NAME poppler-private EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/poppler_private_export.h")
set_target_properties(poppler PROPERTIES VERSION 127.0.0 SOVERSION 127) set_target_properties(poppler PROPERTIES
diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index 52e8687..08ab39a 100644
--- a/glib/CMakeLists.txt --- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt +++ b/glib/CMakeLists.txt
@@ -4,7 +4,7 @@ include_directories( @@ -4,7 +4,7 @@ include_directories(
@@ -66,7 +62,7 @@ index 52e8687..08ab39a 100644
include_directories( include_directories(
- SYSTEM - SYSTEM
+ +
${GLIB2_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS}
) )
@@ -78,9 +74,7 @@ index 52e8687..08ab39a 100644
+target_include_directories(poppler-glib PRIVATE ${CAIRO_INCLUDE_DIRS}) +target_include_directories(poppler-glib PRIVATE ${CAIRO_INCLUDE_DIRS})
install(TARGETS poppler-glib RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS poppler-glib RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES if (ENABLE_NSS3)
diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt
index 5db3a6c..f242d29 100644
--- a/qt5/src/CMakeLists.txt --- a/qt5/src/CMakeLists.txt
+++ b/qt5/src/CMakeLists.txt +++ b/qt5/src/CMakeLists.txt
@@ -45,11 +45,11 @@ if(MINGW AND BUILD_SHARED_LIBS) @@ -45,11 +45,11 @@ if(MINGW AND BUILD_SHARED_LIBS)
@@ -97,8 +91,6 @@ index 5db3a6c..f242d29 100644
endif() endif()
install(TARGETS poppler-qt5 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS poppler-qt5 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/qt6/src/CMakeLists.txt b/qt6/src/CMakeLists.txt
index cd91975..6c42e12 100644
--- a/qt6/src/CMakeLists.txt --- a/qt6/src/CMakeLists.txt
+++ b/qt6/src/CMakeLists.txt +++ b/qt6/src/CMakeLists.txt
@@ -45,11 +45,11 @@ if(MINGW AND BUILD_SHARED_LIBS) @@ -45,11 +45,11 @@ if(MINGW AND BUILD_SHARED_LIBS)
@@ -115,8 +107,6 @@ index cd91975..6c42e12 100644
endif() endif()
install(TARGETS poppler-qt6 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS poppler-qt6 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index afa1352..9bd3b9a 100644
--- a/test/CMakeLists.txt --- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt +++ b/test/CMakeLists.txt
@@ -23,7 +23,7 @@ if (GTK_FOUND) @@ -23,7 +23,7 @@ if (GTK_FOUND)
@@ -146,11 +136,9 @@ index afa1352..9bd3b9a 100644
endif () endif ()
endif () endif ()
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 1c3ebcb..bc1840a 100644
--- a/utils/CMakeLists.txt --- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt
@@ -16,7 +16,7 @@ add_executable(pdftoppm ${pdftoppm_SOURCES}) @@ -18,7 +18,7 @@ add_executable(pdftoppm ${pdftoppm_SOURC
target_link_libraries(pdftoppm ${common_libs}) target_link_libraries(pdftoppm ${common_libs})
if(LCMS2_FOUND) if(LCMS2_FOUND)
target_link_libraries(pdftoppm ${LCMS2_LIBRARIES}) target_link_libraries(pdftoppm ${LCMS2_LIBRARIES})
@@ -159,7 +147,7 @@ index 1c3ebcb..bc1840a 100644
endif() endif()
install(TARGETS pdftoppm DESTINATION bin) install(TARGETS pdftoppm DESTINATION bin)
install(FILES pdftoppm.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) install(FILES pdftoppm.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
@@ -37,10 +37,10 @@ if (HAVE_CAIRO) @@ -39,10 +39,10 @@ if (HAVE_CAIRO)
add_definitions(${CAIRO_CFLAGS}) add_definitions(${CAIRO_CFLAGS})
add_executable(pdftocairo ${pdftocairo_SOURCES}) add_executable(pdftocairo ${pdftocairo_SOURCES})
target_link_libraries(pdftocairo ${CAIRO_LIBRARIES} Freetype::Freetype ${common_libs}) target_link_libraries(pdftocairo ${CAIRO_LIBRARIES} Freetype::Freetype ${common_libs})
@@ -172,16 +160,16 @@ index 1c3ebcb..bc1840a 100644
endif() endif()
install(TARGETS pdftocairo DESTINATION bin) install(TARGETS pdftocairo DESTINATION bin)
install(FILES pdftocairo.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) install(FILES pdftocairo.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
@@ -99,7 +99,7 @@ if (ENABLE_NSS3) @@ -109,7 +109,7 @@ if (ENABLE_SIGNATURES)
pdfsig.cc
)
add_executable(pdfsig ${pdfsig_SOURCES}) add_executable(pdfsig ${pdfsig_SOURCES})
- target_include_directories(pdfsig SYSTEM PRIVATE ${NSS3_INCLUDE_DIRS})
+ target_include_directories(pdfsig PRIVATE ${NSS3_INCLUDE_DIRS})
target_link_libraries(pdfsig ${common_libs}) target_link_libraries(pdfsig ${common_libs})
install(TARGETS pdfsig DESTINATION bin) if (ENABLE_NSS3)
install(FILES pdfsig.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) - target_include_directories(pdfsig SYSTEM PRIVATE ${NSS3_INCLUDE_DIRS})
@@ -114,7 +114,7 @@ add_executable(pdftops ${pdftops_SOURCES}) + target_include_directories(pdfsig PRIVATE ${NSS3_INCLUDE_DIRS})
endif()
if (Intl_FOUND)
target_link_libraries(pdfsig Intl::Intl)
@@ -127,7 +127,7 @@ add_executable(pdftops ${pdftops_SOURCES
target_link_libraries(pdftops ${common_libs}) target_link_libraries(pdftops ${common_libs})
if(LCMS2_FOUND) if(LCMS2_FOUND)
target_link_libraries(pdftops ${LCMS2_LIBRARIES}) target_link_libraries(pdftops ${LCMS2_LIBRARIES})
@@ -1,46 +0,0 @@
From 591235c8b6c65a2eee88991b9ae73490fd9afdfe Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Fri, 18 Aug 2023 11:36:06 +0000
Subject: [PATCH] OutlineItem::open: Fix crash on malformed files
Fixes #1399
CVE: CVE-2023-34872
Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/591235c8b6c65a2eee88991b9ae73490fd9afdfe]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
poppler/Outline.cc | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/poppler/Outline.cc b/poppler/Outline.cc
index cbb6cb4..4c68be9 100644
--- a/poppler/Outline.cc
+++ b/poppler/Outline.cc
@@ -14,7 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com>
-// Copyright (C) 2008, 2016-2019, 2021 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008, 2016-2019, 2021, 2023 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Nick Jones <nick.jones@network-box.com>
// Copyright (C) 2016 Jason Crain <jason@aquaticape.us>
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
@@ -483,8 +483,12 @@ void OutlineItem::open()
{
if (!kids) {
Object itemDict = xref->fetch(ref);
- const Object &firstRef = itemDict.dictLookupNF("First");
- kids = readItemList(this, &firstRef, xref, doc);
+ if (itemDict.isDict()) {
+ const Object &firstRef = itemDict.dictLookupNF("First");
+ kids = readItemList(this, &firstRef, xref, doc);
+ } else {
+ kids = new std::vector<OutlineItem *>();
+ }
}
}
--
2.35.5
File diff suppressed because it is too large Load Diff
@@ -1,111 +0,0 @@
From 0554731052d1a97745cb179ab0d45620589dd9c4 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Fri, 17 Jun 2024 00:54:55 +0200
Subject: [PATCH] pdfinfo: Fix crash in broken documents when using -dests
CVE: CVE-2024-6239
Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/0554731052d1a97745cb179ab0d45620589dd9c4]
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
---
utils/pdfinfo.cc | 35 +++++++++++++++--------------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 2057d22..5f96b41 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -15,7 +15,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2006 Dom Lachowicz <cinamod@hotmail.com>
-// Copyright (C) 2007-2010, 2012, 2016-2022 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2007-2010, 2012, 2016-2022, 2024 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2011 Vittal Aithal <vittal.aithal@cognidox.com>
// Copyright (C) 2012, 2013, 2016-2018, 2021 Adrian Johnson <ajohnson@redneon.com>
@@ -112,16 +112,21 @@ static const ArgDesc argDesc[] = { { "-f", argInt, &firstPage, 0, "first page to
{ "-?", argFlag, &printHelp, 0, "print usage information" },
{} };
-static void printTextString(const GooString *s, const UnicodeMap *uMap)
+static void printStdTextString(const std::string &s, const UnicodeMap *uMap)
{
char buf[8];
- std::vector<Unicode> u = TextStringToUCS4(s->toStr());
+ const std::vector<Unicode> u = TextStringToUCS4(s);
for (const auto &c : u) {
int n = uMap->mapUnicode(c, buf, sizeof(buf));
fwrite(buf, 1, n, stdout);
}
}
+static void printTextString(const GooString *s, const UnicodeMap *uMap)
+{
+ printStdTextString(s->toStr(), uMap);
+}
+
static void printUCS4String(const Unicode *u, int len, const UnicodeMap *uMap)
{
char buf[8];
@@ -293,11 +298,6 @@ static void printStruct(const StructElement *element, unsigned indent)
}
}
-struct GooStringCompare
-{
- bool operator()(GooString *lhs, GooString *rhs) const { return lhs->cmp(const_cast<GooString *>(rhs)) < 0; }
-};
-
static void printLinkDest(const std::unique_ptr<LinkDest> &dest)
{
GooString s;
@@ -368,29 +368,25 @@ static void printLinkDest(const std::unique_ptr<LinkDest> &dest)
static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap)
{
- std::map<Ref, std::map<GooString *, std::unique_ptr<LinkDest>, GooStringCompare>> map;
+ std::map<Ref, std::map<std::string, std::unique_ptr<LinkDest>>> map;
int numDests = doc->getCatalog()->numDestNameTree();
for (int i = 0; i < numDests; i++) {
- GooString *name = new GooString(doc->getCatalog()->getDestNameTreeName(i));
+ const GooString *name = doc->getCatalog()->getDestNameTreeName(i);
std::unique_ptr<LinkDest> dest = doc->getCatalog()->getDestNameTreeDest(i);
- if (dest && dest->isPageRef()) {
+ if (name && dest && dest->isPageRef()) {
Ref pageRef = dest->getPageRef();
- map[pageRef].insert(std::make_pair(name, std::move(dest)));
- } else {
- delete name;
+ map[pageRef].insert(std::make_pair(name->toStr(), std::move(dest)));
}
}
numDests = doc->getCatalog()->numDests();
for (int i = 0; i < numDests; i++) {
- GooString *name = new GooString(doc->getCatalog()->getDestsName(i));
+ const char *name = doc->getCatalog()->getDestsName(i);
std::unique_ptr<LinkDest> dest = doc->getCatalog()->getDestsDest(i);
- if (dest && dest->isPageRef()) {
+ if (name && dest && dest->isPageRef()) {
Ref pageRef = dest->getPageRef();
map[pageRef].insert(std::make_pair(name, std::move(dest)));
- } else {
- delete name;
}
}
@@ -404,9 +400,8 @@ static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap)
printf("%4d ", i);
printLinkDest(it.second);
printf(" \"");
- printTextString(it.first, uMap);
+ printStdTextString(it.first, uMap);
printf("\"\n");
- delete it.first;
}
}
}
--
2.40.0
@@ -1,41 +0,0 @@
From 2986f06c7cc9d64a506ebe861b8bf38f73386e86 Mon Sep 17 00:00:00 2001
From: Jordan Abrahams-Whitehead <ajordanr@google.com>
Date: Tue, 16 May 2023 18:52:19 +0000
Subject: [PATCH] Add missing #include <cstdio> prior to jpeglib.h
Fixes #1398
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
goo/JpegWriter.cc | 2 +-
poppler/ImageEmbeddingUtils.cc | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/goo/JpegWriter.cc b/goo/JpegWriter.cc
index ca69fd055..566ee38f8 100644
--- a/goo/JpegWriter.cc
+++ b/goo/JpegWriter.cc
@@ -23,7 +23,7 @@
#ifdef ENABLE_LIBJPEG
# include "poppler/Error.h"
-
+# include <cstdio>
extern "C" {
# include <jpeglib.h>
}
diff --git a/poppler/ImageEmbeddingUtils.cc b/poppler/ImageEmbeddingUtils.cc
index 0c13fe968..07b9dfb62 100644
--- a/poppler/ImageEmbeddingUtils.cc
+++ b/poppler/ImageEmbeddingUtils.cc
@@ -14,6 +14,7 @@
#include <memory>
#ifdef ENABLE_LIBJPEG
+# include <cstdio>
extern "C" {
# include <jpeglib.h>
}
--
GitLab
@@ -7,12 +7,8 @@ SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \
file://0001-Do-not-overwrite-all-our-build-flags.patch \ file://0001-Do-not-overwrite-all-our-build-flags.patch \
file://basename-include.patch \ file://basename-include.patch \
file://0001-cmake-Do-not-use-isystem.patch \ file://0001-cmake-Do-not-use-isystem.patch \
file://jpeg-stdio.patch \
file://CVE-2023-34872.patch \
file://CVE-2024-6239-0001.patch \
file://CVE-2024-6239-0002.patch \
" "
SRC_URI[sha256sum] = "b6d893dc7dcd4138b9e9df59a13c59695e50e80dc5c2cacee0674670693951a1" SRC_URI[sha256sum] = "ebd857987e2395608c69fdc44009692d5906f13b612c5280beff65a0b75dc255"
DEPENDS = "fontconfig zlib cairo lcms glib-2.0 glib-2.0-native" DEPENDS = "fontconfig zlib cairo lcms glib-2.0 glib-2.0-native"
@@ -27,6 +23,8 @@ PACKAGECONFIG[openjpeg] = "-DENABLE_LIBOPENJPEG=openjpeg2,-DENABLE_LIBOPENJPEG=n
PACKAGECONFIG[qt5] = "-DENABLE_QT5=ON,-DENABLE_QT5=OFF,qtbase qttools-native" PACKAGECONFIG[qt5] = "-DENABLE_QT5=ON,-DENABLE_QT5=OFF,qtbase qttools-native"
PACKAGECONFIG[nss] = "-DWITH_NSS3=ON,-DWITH_NSS3=OFF,nss" PACKAGECONFIG[nss] = "-DWITH_NSS3=ON,-DWITH_NSS3=OFF,nss"
PACKAGECONFIG[splash] = "-DENABLE_SPLASH=ON -DENABLE_BOOST=ON,-DENABLE_SPLASH=OFF -DENABLE_BOOST=OFF,boost" PACKAGECONFIG[splash] = "-DENABLE_SPLASH=ON -DENABLE_BOOST=ON,-DENABLE_SPLASH=OFF -DENABLE_BOOST=OFF,boost"
PACKAGECONFIG[gpgme] = "-DENABLE_GPGME=ON,-DENABLE_GPGME=OFF,gpgme"
PACKAGECONFIG[qt6] = "-DENABLE_QT6=ON,-DENABLE_QT6=OFF,qtbase"
# surprise - did not expect this to work :) # surprise - did not expect this to work :)
inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt5', 'cmake_qt5', '', d)} inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt5', 'cmake_qt5', '', d)}