diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-03-20 00:40:44 +0000 |
commit | 4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch) | |
tree | 356496503d52354aa6d9f2d36126302fed5f3a73 /sci-libs/gdal/files | |
parent | fcc5224904648a8e6eb528d7603154160a20022f (diff) |
gentoo resync : 20.03.2022
Diffstat (limited to 'sci-libs/gdal/files')
-rw-r--r-- | sci-libs/gdal/files/gdal-3.4.1-poppler-22.03.0.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sci-libs/gdal/files/gdal-3.4.1-poppler-22.03.0.patch b/sci-libs/gdal/files/gdal-3.4.1-poppler-22.03.0.patch new file mode 100644 index 000000000000..94640e046a1b --- /dev/null +++ b/sci-libs/gdal/files/gdal-3.4.1-poppler-22.03.0.patch @@ -0,0 +1,54 @@ +From 17e98757e78969a199d1d6318f53d088da192191 Mon Sep 17 00:00:00 2001 +From: Even Rouault <even.rouault@spatialys.com> +Date: Fri, 18 Feb 2022 22:47:01 +0100 +Subject: [PATCH] PDF: fix build against Poppler > 22.2 + +--- + frmts/pdf/pdfdataset.cpp | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/frmts/pdf/pdfdataset.cpp b/frmts/pdf/pdfdataset.cpp +index 22238bd74822..08f8e31c86a7 100644 +--- a/frmts/pdf/pdfdataset.cpp ++++ b/frmts/pdf/pdfdataset.cpp +@@ -4241,8 +4241,6 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo ) + #ifdef HAVE_POPPLER + if(bUseLib.test(PDFLIB_POPPLER)) + { +- GooString* poUserPwd = nullptr; +- + static bool globalParamsCreatedByGDAL = false; + { + CPLMutexHolderD(&hGlobalParamsMutex); +@@ -4310,9 +4308,6 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo ) + while( true ) + { + VSIFSeekL(fp, 0, SEEK_SET); +- if (pszUserPwd) +- poUserPwd = new GooString(pszUserPwd); +- + g_nPopplerErrors = 0; + if( globalParamsCreatedByGDAL ) + registerErrorCallback(); +@@ -4322,10 +4317,20 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo ) + oObj.getObj()->initNull(); + auto poStream = new VSIPDFFileStream(fp, pszFilename, oObj.getObj()); + #endif ++#if POPPLER_MAJOR_VERSION > 22 || (POPPLER_MAJOR_VERSION == 22 && POPPLER_MINOR_VERSION > 2) ++ std::optional<GooString> osUserPwd; ++ if (pszUserPwd) ++ osUserPwd = std::optional<GooString>(pszUserPwd); ++ poDocPoppler = new PDFDoc(poStream, std::optional<GooString>(), osUserPwd); ++#else ++ GooString* poUserPwd = nullptr; ++ if (pszUserPwd) ++ poUserPwd = new GooString(pszUserPwd); + poDocPoppler = new PDFDoc(poStream, nullptr, poUserPwd); ++ delete poUserPwd; ++#endif + if( globalParamsCreatedByGDAL ) + registerErrorCallback(); +- delete poUserPwd; + if( g_nPopplerErrors >= MAX_POPPLER_ERRORS ) + { + PDFFreeDoc(poDocPoppler); |