From de68ee13e42f020c8361e3422fdcb42c9cb52318 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 17 Jun 2025 10:41:25 +0200 Subject: [PATCH] tdf#167010: fix build when poppler is older than 25.2.0 After commit 4f13305178c1bf88dffceb42ec15d0944b808a5c Author: Xisco Fauli Date: Wed Apr 2 16:27:00 2025 +0200 poppler: upgrade to 25.04.0 and the upstream commit commit 5d71c95d08aa0e097f711254e1c69ee0cf275328 Author: Nelson Benítez León Date: Sun Jan 5 21:33:23 2025 +0000 Detect malformed Streams in Annot Appearances Change-Id: Id308aac0331a77aca88ebf8e31bf3aa0a688533a --- diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index 604ba3b..f4b03f0 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -231,8 +231,12 @@ #else str = ((DCTStream *)str)->getRawStream(); #endif +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!str->reset()) return; +#else + str->reset(); +#endif o_rOutputBuf.clear(); ExtractJpegData(str, o_rOutputBuf); @@ -268,8 +272,12 @@ o_rOutputBuf.resize(header_size); // initialize stream +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!str->reset()) return; +#else + str->reset(); +#endif // copy the raw stream if( bInvert ) @@ -326,8 +334,12 @@ width, colorMap->getNumPixelComps(), colorMap->getBits())); +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!imgStr->reset()) return; +#else + imgStr->reset(); +#endif for( int y=0; yreset()) return; +#else + str->reset(); +#endif for( int y = 0; y < height; y++ ) { // determine filter type (none) for this scanline @@ -253,8 +257,12 @@ width, colorMap->getNumPixelComps(), colorMap->getBits())); +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!imgStr->reset()) return; +#else + imgStr->reset(); +#endif // create scan line data buffer OutputBuffer aScanlines; @@ -291,8 +299,12 @@ maskColorMap->getNumPixelComps(), maskColorMap->getBits())); +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!imgStrMask->reset()) return; +#else + imgStrMask->reset(); +#endif for( int y = 0; y < maskHeight; ++y ) { @@ -341,8 +353,12 @@ width, colorMap->getNumPixelComps(), colorMap->getBits())); +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!imgStr->reset()) return; +#else + imgStr->reset(); +#endif // create scan line data buffer OutputBuffer aScanlines; @@ -376,8 +392,12 @@ std::unique_ptr imgStrMask( new ImageStream(maskStr, maskWidth, 1, 1)); +#if POPPLER_CHECK_VERSION(25, 2, 0) if (!imgStrMask->reset()) return; +#else + imgStrMask->reset(); +#endif for( int y = 0; y < maskHeight; ++y ) {