diff --git a/print/cups-filters/Makefile b/print/cups-filters/Makefile index 5034f538345e..3b39149bb9f4 100644 --- a/print/cups-filters/Makefile +++ b/print/cups-filters/Makefile @@ -1,177 +1,157 @@ PORTNAME= cups-filters PORTVERSION= 1.28.17 PORTREVISION= 11 CATEGORIES= print -MASTER_SITES= https://github.com/OpenPrinting/cups-filters/releases/download/${DISTVERSION}/ - -PATCH_SITES= https://github.com/OpenPrinting/cups-filters/commit/ -PATCHFILES= 9799398713b941557642d0b2bdbef360837ece0c.diff:-p1 \ - 93e60d3df358c0ae6f3dba79e1c9684657683d89.diff:-p1 \ - d72184e725591f10e2b404b36fe3bf5bc304a299.diff:-p1 \ - e25fd59a7daed00b6a9f235bd5818116fca28e30.diff:-p1 \ - 0cce0968980e8fdd9053cba436a66246b2303a84.diff:-p1 \ - 7b191cb1d4d0fc97ccbbd0fe43eec2544fe0c11e.diff:-p1 \ - 7992eb7c6e4abeffd766f54c98cbb2cbb45c5c04.diff:-p1 \ - 770ec883e68e505c1d1856a42b78f9323dc326a6.diff:-p1 \ - 2076627d33477212f21352ad39e9d305adb63af3.diff:-p1 \ - 10fb02eaaee52e0be9b16917b38aa8ec5bddd87f.diff:-p1 \ - b7461ec2a8d1f2aa627b24e01e118ec4cca78ec0.diff:-p1 \ - 6fd2bdfbdce76149af531ce9fca9062304238451.patch:-p1 \ - 3534e01cb41ddfa61ac78d32052b8822df71d97d.patch:-p1 \ - b378f09c9b8aaa8dccb5eb557938b30da874101d.patch:-p1 \ - c8522bb128546a1910bca538a504a2c9363ebb22.patch:-p1 \ - dccb537afe85af3ea01e3f274974d9d1f53f8e14.patch:-p1 \ - d5cc66b410a3246e74b71f718e86504d08e4bfa3.patch:-p1 \ - 86b060d2ac20d6dee757c609286cfaaa17d65428.patch:-p1 \ - d43610f82e1757b45925a8830ac297ff9dc4abca.patch:-p1 MAINTAINER= tijl@FreeBSD.org COMMENT= Additional backends, filters and other software for CUPS WWW= https://wiki.linuxfoundation.org/openprinting/cups-filters LICENSE= BSD4CLAUSE GPLv2 GPLv2+ GPLv3 GPLv3+ LGPL20 LGPL21+ MIT LICENSE_COMB= multi BUILD_DEPENDS= ${LOCALBASE}/share/fonts/dejavu/DejaVuSans.ttf:x11-fonts/dejavu LIB_DEPENDS= liblcms2.so:graphics/lcms2 \ libqpdf.so:print/qpdf \ libcups.so:print/cups \ libfreetype.so:print/freetype2 \ libfontconfig.so:x11-fonts/fontconfig USES= autoreconf compiler:c++11-lib cpe gettext-tools gmake gnome \ iconv libtool localbase pkgconfig shebangfix tar:xz +CPE_VENDOR= linuxfoundation +USE_GITHUB= yes +GH_ACCOUNT= OpenPrinting +GH_TAGNAME= f87687970d9c USE_GNOME= glib20 USE_LDCONFIG= yes USE_RC_SUBR= cups_browsed -CONFLICTS= foomatic-filters # bin/foomatic-rip - -CPE_VENDOR= linuxfoundation SHEBANG_FILES= filter/braille/drivers/generic/brftoembosser.in \ filter/braille/drivers/index/imageubrltoindexv3.in \ filter/braille/drivers/index/imageubrltoindexv4.in \ filter/braille/drivers/index/textbrftoindexv3.in \ filter/braille/filters/brftopagedbrf.in \ filter/braille/filters/imagetobrf.in \ filter/braille/filters/liblouis1.defs.gen.in \ filter/braille/filters/musicxmltobrf.in \ filter/braille/filters/texttobrf.in \ filter/braille/filters/vectortobrf.in \ filter/braille/filters/vectortopdf.in GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-shell=/bin/sh \ --with-pdftops-path=${LOCALBASE}/bin/pdftops \ --with-test-font-path=${LOCALBASE}/share/fonts/dejavu/DejaVuSans.ttf -GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share INSTALL_TARGET= install-strip +CONFLICTS= foomatic-filters # bin/foomatic-rip + OPTIONS_DEFINE= BRAILLE COLORD DOCS OPTIONS_GROUP= FILTERS CUPS_BROWSED OPTIONS_GROUP_FILTERS= GHOSTSCRIPT IMAGES MUPDF POPPLER OPTIONS_GROUP_CUPS_BROWSED= AVAHI LDAP OPTIONS_SINGLE= PDFTOPS OPTIONS_SINGLE_PDFTOPS= PSGHOSTSCRIPT PSHYBRID PSMUPDF PSPOPPLER OPTIONS_DEFAULT= COLORD GHOSTSCRIPT IMAGES POPPLER AVAHI LDAP \ PSHYBRID OPTIONS_SUB= yes BRAILLE_CONFIGURE_ENABLE= braille BRAILLE_DESC= Braille embosser support BRAILLE_USES= magick:run BRAILLE_BUILD_DEPENDS= bash:shells/bash BRAILLE_LIB_DEPENDS= liblouis.so:devel/liblouis \ # liblouisutdml.so:devel/liblouisutdml BRAILLE_RUN_DEPENDS= pdftotext:graphics/poppler-utils \ bash:shells/bash COLORD_CONFIGURE_ENABLE= dbus COLORD_DESC= Get ICC color profiles from colord (via D-Bus) COLORD_LIB_DEPENDS= libdbus-1.so:devel/dbus COLORD_RUN_DEPENDS= colord>0:graphics/colord # Filters FILTERS_DESC= Filters GHOSTSCRIPT_CONFIGURE_ENABLE= ghostscript GHOSTSCRIPT_DESC= PS-to-PDF and PS/PDF-to-raster using Ghostscript GHOSTSCRIPT_USES= ghostscript IMAGES_CONFIGURE_ENABLE= exif imagefilters IMAGES_CONFIGURE_WITH= jpeg png tiff IMAGES_DESC= Accept JPEG, PNG, and TIFF files as input IMAGES_LIB_DEPENDS= libexif.so:graphics/libexif \ libpng.so:graphics/png \ libtiff.so:graphics/tiff IMAGES_USES= jpeg MUPDF_BUILD_DEPENDS= mutool:graphics/mupdf MUPDF_RUN_DEPENDS= mutool:graphics/mupdf MUPDF_CONFIGURE_ENABLE= mutool MUPDF_DESC= PDF-to-raster using MuPDF POPPLER_CONFIGURE_ENABLE= poppler POPPLER_DESC= PDF-to-raster using Poppler POPPLER_LIB_DEPENDS= libpoppler-cpp.so:graphics/poppler # cups-browsed(8) options CUPS_BROWSED_DESC= cups-browsed(8) options AVAHI_CONFIGURE_ENABLE= avahi AVAHI_CONFIGURE_OFF= --with-browseremoteprotocols=none AVAHI_CONFIGURE_ON= --with-browseremoteprotocols=dnssd AVAHI_DESC= Discover Zeroconf/Bonjour network printers AVAHI_LIB_DEPENDS= libavahi-client.so:net/avahi-app AVAHI_SUB_LIST= AVAHI_DAEMON=avahi_daemon AVAHI_SUB_LIST_OFF= AVAHI_DAEMON= LDAP_CONFIGURE_ENABLE= ldap LDAP_DESC= Get printer locations from an LDAP server LDAP_USES= ldap # Default PDF-to-PostScript renderer PDFTOPS_DESC= Default PDF-to-PostScript renderer PSGHOSTSCRIPT_CONFIGURE_ON= --with-pdftops=gs PSGHOSTSCRIPT_DESC= Ghostscript gs(1) PSGHOSTSCRIPT_IMPLIES= GHOSTSCRIPT PSHYBRID_BUILD_DEPENDS= pdftops:graphics/poppler-utils PSHYBRID_RUN_DEPENDS= pdftops:graphics/poppler-utils PSHYBRID_CONFIGURE_ON= --with-pdftops=hybrid PSHYBRID_DESC= Ghostscript or Poppler depending on printer PSHYBRID_IMPLIES= GHOSTSCRIPT PSMUPDF_CONFIGURE_ON= --with-pdftops=mupdf PSMUPDF_DESC= MuPDF mutool(1) PSMUPDF_IMPLIES= MUPDF PSPOPPLER_BUILD_DEPENDS= pdftops:graphics/poppler-utils PSPOPPLER_RUN_DEPENDS= pdftops:graphics/poppler-utils PSPOPPLER_CONFIGURE_ON= --with-pdftops=pdftops PSPOPPLER_DESC= Poppler pdftops(1) .include #.if ${OPSYS} == FreeBSD .if ${COMPILER_TYPE} == clang CFLAGS+= -Wno-error=dynamic-exception-spec .endif post-patch: @${REINPLACE_CMD} -e 's|/usr/share|${PREFIX}/share|' \ -e 's|/etc|${PREFIX}&|' \ -e 's|README.gz|README|' \ ${WRKSRC}/utils/cups-browsed.8 \ ${WRKSRC}/utils/cups-browsed.conf.5 \ ${WRKSRC}/utils/driverless.1 post-install: @${MV} ${STAGEDIR}${PREFIX}/etc/cups/cups-browsed.conf \ ${STAGEDIR}${PREFIX}/etc/cups/cups-browsed.conf.sample .include diff --git a/print/cups-filters/distinfo b/print/cups-filters/distinfo index db3d2ef4cbda..da5dd1a0e8bb 100644 --- a/print/cups-filters/distinfo +++ b/print/cups-filters/distinfo @@ -1,41 +1,3 @@ -TIMESTAMP = 1755616897 -SHA256 (cups-filters-1.28.17.tar.xz) = 270a3752a960368aa99d431fb5d34f4039b2ac943c576d840612d1d8185c9bb9 -SIZE (cups-filters-1.28.17.tar.xz) = 1516052 -SHA256 (9799398713b941557642d0b2bdbef360837ece0c.diff) = c9a061b3c415ff547161360c4fc90e0584c65efbfea90564ec34eb0e2edddf77 -SIZE (9799398713b941557642d0b2bdbef360837ece0c.diff) = 552 -SHA256 (93e60d3df358c0ae6f3dba79e1c9684657683d89.diff) = 445ca6b24390711a2bf7c1056d93628930accbfd974d1533c9b915efd455ad89 -SIZE (93e60d3df358c0ae6f3dba79e1c9684657683d89.diff) = 5272 -SHA256 (d72184e725591f10e2b404b36fe3bf5bc304a299.diff) = 53b883e7b29428cb6dd405143df9abb888ef03573ea2e063cd92d55ca821c3ce -SIZE (d72184e725591f10e2b404b36fe3bf5bc304a299.diff) = 1321 -SHA256 (e25fd59a7daed00b6a9f235bd5818116fca28e30.diff) = 38a08df9c764cac3cdaaf7de24d41663bb8f538c07fbd92412bc06627c20139e -SIZE (e25fd59a7daed00b6a9f235bd5818116fca28e30.diff) = 1902 -SHA256 (0cce0968980e8fdd9053cba436a66246b2303a84.diff) = 0d3a162dfa47c3fcde2524edaabf082f713eba16c48c8ed8b6bba69a80d5b7cd -SIZE (0cce0968980e8fdd9053cba436a66246b2303a84.diff) = 697 -SHA256 (7b191cb1d4d0fc97ccbbd0fe43eec2544fe0c11e.diff) = 662629140a354fc2613be9e8cc72cfb2010fc063a72c0262c62625a281db5a68 -SIZE (7b191cb1d4d0fc97ccbbd0fe43eec2544fe0c11e.diff) = 2551 -SHA256 (7992eb7c6e4abeffd766f54c98cbb2cbb45c5c04.diff) = 983767662fe249e0968ab647e2c59ced4de9f8d96572484e6957656d000e85e9 -SIZE (7992eb7c6e4abeffd766f54c98cbb2cbb45c5c04.diff) = 559 -SHA256 (770ec883e68e505c1d1856a42b78f9323dc326a6.diff) = ffbe02cdb2c4c148a6bb3684c1b08c5c5dcf3372201e0c01729d667e1958a211 -SIZE (770ec883e68e505c1d1856a42b78f9323dc326a6.diff) = 1424 -SHA256 (2076627d33477212f21352ad39e9d305adb63af3.diff) = bfef9f5571da6a05ca0588b42ce634156595badcba66c3eba9de5c4b0cce7ead -SIZE (2076627d33477212f21352ad39e9d305adb63af3.diff) = 561 -SHA256 (10fb02eaaee52e0be9b16917b38aa8ec5bddd87f.diff) = 6e16e9f046a8bfcbd1552d90e5ef1573f25ec3d39d0ef8330da89d32e9e4bc13 -SIZE (10fb02eaaee52e0be9b16917b38aa8ec5bddd87f.diff) = 460 -SHA256 (b7461ec2a8d1f2aa627b24e01e118ec4cca78ec0.diff) = 9d6d64a20ee0859767ce48df665b429a22a42e213c1aeb2480adeb68bcd4b334 -SIZE (b7461ec2a8d1f2aa627b24e01e118ec4cca78ec0.diff) = 700 -SHA256 (6fd2bdfbdce76149af531ce9fca9062304238451.patch) = 50e450d9cf4fedbac7980661cb5cab2cd3e9faa117747479e92bef5b255194d8 -SIZE (6fd2bdfbdce76149af531ce9fca9062304238451.patch) = 67608 -SHA256 (3534e01cb41ddfa61ac78d32052b8822df71d97d.patch) = ba3f6ed5b9ac0e18100ceed25aedebd29109799c1aa93505131d9264eb09b4b8 -SIZE (3534e01cb41ddfa61ac78d32052b8822df71d97d.patch) = 5483 -SHA256 (b378f09c9b8aaa8dccb5eb557938b30da874101d.patch) = 491d5355d14a255fa9de4d8e3cdec0c0cd49064811cecaec306be3db1ca933fa -SIZE (b378f09c9b8aaa8dccb5eb557938b30da874101d.patch) = 2683 -SHA256 (c8522bb128546a1910bca538a504a2c9363ebb22.patch) = 426f85b5c64af1d5af778606bbfbaaef4719679dd1881525604202e02778e211 -SIZE (c8522bb128546a1910bca538a504a2c9363ebb22.patch) = 1300 -SHA256 (dccb537afe85af3ea01e3f274974d9d1f53f8e14.patch) = 413ccdce64d3f6886ab4fb956a485e58707a769a5ef725c86517a21058683782 -SIZE (dccb537afe85af3ea01e3f274974d9d1f53f8e14.patch) = 1160 -SHA256 (d5cc66b410a3246e74b71f718e86504d08e4bfa3.patch) = 0a7dd41fd646da9a36d4388d38017665512f03db35874a629a976df57ea76516 -SIZE (d5cc66b410a3246e74b71f718e86504d08e4bfa3.patch) = 1406 -SHA256 (86b060d2ac20d6dee757c609286cfaaa17d65428.patch) = 9211eb922e5cda81df3b02f7844c216c674e3c340bc80ac4e94593fc73084e66 -SIZE (86b060d2ac20d6dee757c609286cfaaa17d65428.patch) = 1023 -SHA256 (d43610f82e1757b45925a8830ac297ff9dc4abca.patch) = 5eea2ad0f42b683f12c8e381f49e8fa2cc511aa61a6e407ac3adaf1d0b29db00 -SIZE (d43610f82e1757b45925a8830ac297ff9dc4abca.patch) = 1144 +TIMESTAMP = 1764429115 +SHA256 (OpenPrinting-cups-filters-1.28.17-f87687970d9c_GH0.tar.gz) = e063eb0677f6a5dc971cc449e30d58327d2c9c088dc2311fec1d3ecb26bc2b70 +SIZE (OpenPrinting-cups-filters-1.28.17-f87687970d9c_GH0.tar.gz) = 1503588 diff --git a/print/cups-filters/files/patch-0001-c3d2f07399da b/print/cups-filters/files/patch-0001-c3d2f07399da deleted file mode 100644 index 470492a6d495..000000000000 --- a/print/cups-filters/files/patch-0001-c3d2f07399da +++ /dev/null @@ -1,170 +0,0 @@ -From c3d2f07399da93f2b5308f499b1ddc5504d087ce Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Noack?= -Date: Thu, 10 Jul 2025 22:31:02 +0200 -Subject: [PATCH] 1.x: Fix NULL-pointer dereference when parsing %%PDFTOPDF - comments (#644) - -* Fix null pointer dereference in %%PDFTOPDF* parsers - -* %%PDFTOPDFCollate comment parsing: Increment p where needed - -Without this, if strchr succeeds, p will point to a ':' character. -*p will therefore never be a whitespace in the subsequent loop, -or compare successfully against the "true" string. ---- - filter/gstoraster.c | 17 +++++++++++------ - filter/mupdftoraster.c | 17 +++++++++++------ - filter/pdftops.c | 36 +++++++++++++++++++++--------------- - filter/pdftoraster.cxx | 17 +++++++++++------ - 4 files changed, 54 insertions(+), 33 deletions(-) - -diff --git a/filter/gstoraster.c b/filter/gstoraster.c -index 87ff948e6..6f4da5991 100644 ---- filter/gstoraster.c -+++ filter/gstoraster.c -@@ -104,16 +104,21 @@ parse_pdf_header_options(FILE *fp, gs_page_header *h) - char *p; - - p = strchr(buf+19,':'); -- h->NumCopies = atoi(p+1); -+ if (p) { -+ h->NumCopies = atoi(p+1); -+ } - } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) { - char *p; - - p = strchr(buf+17,':'); -- while (*p == ' ' || *p == '\t') p++; -- if (strncasecmp(p,"true",4) == 0) { -- h->Collate = CUPS_TRUE; -- } else { -- h->Collate = CUPS_FALSE; -+ if (p) { -+ p++; -+ while (*p == ' ' || *p == '\t') p++; -+ if (strncasecmp(p,"true",4) == 0) { -+ h->Collate = CUPS_TRUE; -+ } else { -+ h->Collate = CUPS_FALSE; -+ } - } - } - } -diff --git a/filter/mupdftoraster.c b/filter/mupdftoraster.c -index 09c66c00d..a96e9c8c3 100644 ---- filter/mupdftoraster.c -+++ filter/mupdftoraster.c -@@ -102,16 +102,21 @@ parse_pdf_header_options(FILE *fp, mupdf_page_header *h) - char *p; - - p = strchr(buf+19,':'); -- h->NumCopies = atoi(p+1); -+ if (p) { -+ h->NumCopies = atoi(p+1); -+ } - } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) { - char *p; - - p = strchr(buf+17,':'); -- while (*p == ' ' || *p == '\t') p++; -- if (strncasecmp(p,"true",4) == 0) { -- h->Collate = CUPS_TRUE; -- } else { -- h->Collate = CUPS_FALSE; -+ if (p) { -+ p++; -+ while (*p == ' ' || *p == '\t') p++; -+ if (strncasecmp(p,"true",4) == 0) { -+ h->Collate = CUPS_TRUE; -+ } else { -+ h->Collate = CUPS_FALSE; -+ } - } - } - } -diff --git a/filter/pdftops.c b/filter/pdftops.c -index 1bfe1a2c7..81ccc983e 100644 ---- filter/pdftops.c -+++ filter/pdftops.c -@@ -138,25 +138,31 @@ static void parsePDFTOPDFComment(char *filename) - if (strncmp(buf,"%%PDFTOPDFNumCopies",19) == 0) { - char *p; - -- p = strchr(buf+19,':') + 1; -- while (*p == ' ' || *p == '\t') p++; -- strncpy(deviceCopies, p, sizeof(deviceCopies)); -- deviceCopies[sizeof(deviceCopies) - 1] = '\0'; -- p = deviceCopies + strlen(deviceCopies) - 1; -- while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') p--; -- *(p + 1) = '\0'; -- pdftopdfapplied = 1; -+ p = strchr(buf+19,':'); -+ if (p) { -+ p++; -+ while (*p == ' ' || *p == '\t') p++; -+ strncpy(deviceCopies, p, sizeof(deviceCopies)); -+ deviceCopies[sizeof(deviceCopies) - 1] = '\0'; -+ p = deviceCopies + strlen(deviceCopies) - 1; -+ while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') p--; -+ *(p + 1) = '\0'; -+ pdftopdfapplied = 1; -+ } - } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) { - char *p; - -- p = strchr(buf+17,':') + 1; -- while (*p == ' ' || *p == '\t') p++; -- if (strncasecmp(p,"true",4) == 0) { -- deviceCollate = 1; -- } else { -- deviceCollate = 0; -+ p = strchr(buf+17,':'); -+ if (p) { -+ p++; -+ while (*p == ' ' || *p == '\t') p++; -+ if (strncasecmp(p,"true",4) == 0) { -+ deviceCollate = 1; -+ } else { -+ deviceCollate = 0; -+ } -+ pdftopdfapplied = 1; - } -- pdftopdfapplied = 1; - } else if (strcmp(buf,"% This file was generated by pdftopdf") == 0) { - pdftopdfapplied = 1; - } -diff --git a/filter/pdftoraster.cxx b/filter/pdftoraster.cxx -index 1bdde0b1d..7b3af924f 100755 ---- filter/pdftoraster.cxx -+++ filter/pdftoraster.cxx -@@ -489,16 +489,21 @@ static void parsePDFTOPDFComment(FILE *fp) - char *p; - - p = strchr(buf+19,':'); -- deviceCopies = atoi(p+1); -+ if (p) { -+ deviceCopies = atoi(p+1); -+ } - } else if (strncmp(buf,"%%PDFTOPDFCollate",17) == 0) { - char *p; - - p = strchr(buf+17,':'); -- while (*p == ' ' || *p == '\t') p++; -- if (strncasecmp(p,"true",4) == 0) { -- deviceCollate = true; -- } else { -- deviceCollate = false; -+ if (p) { -+ p++; -+ while (*p == ' ' || *p == '\t') p++; -+ if (strncasecmp(p,"true",4) == 0) { -+ deviceCollate = true; -+ } else { -+ deviceCollate = false; -+ } - } - } - } --- -2.50.1 - diff --git a/print/cups-filters/files/patch-0002-qpdf12 b/print/cups-filters/files/patch-0002-qpdf12 deleted file mode 100644 index b1eed7ab207b..000000000000 --- a/print/cups-filters/files/patch-0002-qpdf12 +++ /dev/null @@ -1,292 +0,0 @@ ---- configure.ac.orig 2025-08-19 16:30:13 UTC -+++ configure.ac -@@ -793,9 +793,7 @@ CFLAGS="$CFLAGS -D_GNU_SOURCE" - CXXFLAGS="$CXXFLAGS -Wall " # -Weffc++" # TODO: enable when it does not print 1MB of warnings - ]) - CFLAGS="$CFLAGS -D_GNU_SOURCE" --CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE -DPOINTERHOLDER_TRANSITION=0" --# ^^ Silence deprecation warnings of QPDF 11 --# See /usr/include/qpdf/PointerHolder.hh -+CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE" - CXXFLAGS="$CXXFLAGS -std=c++17" # Needed to build with current QPDF (11.x) - - # ========================== ---- filter/pdf.cxx.orig 2023-01-25 01:41:08 UTC -+++ filter/pdf.cxx -@@ -138,7 +138,7 @@ extern "C" void pdf_prepend_stream(pdf_t *pdf, - } - - // prepare the new stream which is to be prepended -- PointerHolder stream_data = PointerHolder(new Buffer(len)); -+ std::shared_ptr stream_data = std::shared_ptr(new Buffer(len)); - memcpy(stream_data->getBuffer(), buf, len); - QPDFObjectHandle stream = QPDFObjectHandle::newStream(pdf, stream_data); - stream = pdf->makeIndirectObject(stream); ---- filter/pdftopdf/qpdf_pdftopdf_processor.cc.orig 2023-01-25 01:41:08 UTC -+++ filter/pdftopdf/qpdf_pdftopdf_processor.cc -@@ -83,10 +83,10 @@ QPDFObjectHandle QPDF_PDFTOPDF_PageHandle::get() // {{ - page.getKey("/Resources").replaceKey("/XObject",QPDFObjectHandle::newDictionary(xobjs)); - content.append("Q\n"); - page.getKey("/Contents").replaceStreamData(content,QPDFObjectHandle::newNull(),QPDFObjectHandle::newNull()); -- page.replaceOrRemoveKey("/Rotate",makeRotate(rotation)); -+ page.replaceKey("/Rotate",makeRotate(rotation)); - } else { - Rotation rot=getRotate(page)+rotation; -- page.replaceOrRemoveKey("/Rotate",makeRotate(rot)); -+ page.replaceKey("/Rotate",makeRotate(rot)); - } - page=QPDFObjectHandle(); // i.e. uninitialized - return ret; -@@ -181,9 +181,9 @@ Rotation QPDF_PDFTOPDF_PageHandle::crop(const PageRect - page.assertInitialized(); - Rotation save_rotate = getRotate(page); - if(orientation==ROT_0||orientation==ROT_180) -- page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_90)); -+ page.replaceKey("/Rotate",makeRotate(ROT_90)); - else -- page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_0)); -+ page.replaceKey("/Rotate",makeRotate(ROT_0)); - - PageRect currpage= getBoxAsRect(getTrimBox(page)); - double width = currpage.right-currpage.left; -@@ -242,7 +242,7 @@ Rotation QPDF_PDFTOPDF_PageHandle::crop(const PageRect - //Cropping. - // TODO: Borders are covered by the image. buffer space? - page.replaceKey("/TrimBox",makeBox(currpage.left,currpage.bottom,currpage.right,currpage.top)); -- page.replaceOrRemoveKey("/Rotate",makeRotate(save_rotate)); -+ page.replaceKey("/Rotate",makeRotate(save_rotate)); - return getRotate(page); - } - -@@ -251,14 +251,14 @@ bool QPDF_PDFTOPDF_PageHandle::is_landscape(Rotation o - page.assertInitialized(); - Rotation save_rotate = getRotate(page); - if(orientation==ROT_0||orientation==ROT_180) -- page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_90)); -+ page.replaceKey("/Rotate",makeRotate(ROT_90)); - else -- page.replaceOrRemoveKey("/Rotate",makeRotate(ROT_0)); -+ page.replaceKey("/Rotate",makeRotate(ROT_0)); - - PageRect currpage= getBoxAsRect(getTrimBox(page)); - double width = currpage.right-currpage.left; - double height = currpage.top-currpage.bottom; -- page.replaceOrRemoveKey("/Rotate",makeRotate(save_rotate)); -+ page.replaceKey("/Rotate",makeRotate(save_rotate)); - if(width>height) - return true; - return false; -@@ -662,7 +662,7 @@ void QPDF_PDFTOPDF_Processor::autoRotateAll(bool dst_l - // TODO? other rotation direction, e.g. if (src_rot==ROT_0)&&(param.orientation==ROT_270) ... etc. - // rotation=ROT_270; - -- page.replaceOrRemoveKey("/Rotate",makeRotate(src_rot+rotation)); -+ page.replaceKey("/Rotate",makeRotate(src_rot+rotation)); - } - } - } ---- filter/pdftopdf/qpdf_xobject.cc.orig 2025-08-19 16:30:13 UTC -+++ filter/pdftopdf/qpdf_xobject.cc -@@ -138,7 +138,7 @@ QPDFObjectHandle makeXObject(QPDF *pdf,QPDFObjectHandl - - std::vector contents=page.getPageContents(); // (will assertPageObject) - -- auto ph=PointerHolder(new CombineFromContents_Provider(contents)); -+ auto ph=std::shared_ptr(new CombineFromContents_Provider(contents)); - ret.replaceStreamData(ph,filter,decode_parms); - - return ret; ---- filter/rastertopdf.cpp.orig 2023-01-25 01:41:08 UTC -+++ filter/rastertopdf.cpp -@@ -310,10 +310,10 @@ struct pdf_info - std::vector pclm_source_resolution_supported; - std::string pclm_source_resolution_default; - std::string pclm_raster_back_side; -- std::vector< PointerHolder > pclm_strip_data; -+ std::vector< std::shared_ptr > pclm_strip_data; - std::string render_intent; - cups_cspace_t color_space; -- PointerHolder page_data; -+ std::shared_ptr page_data; - double page_width,page_height; - OutFormatType outformat; - }; -@@ -442,7 +442,7 @@ QPDFObjectHandle embedIccProfile(QPDF &pdf) - std::map streamdict; - std::string n_value = ""; - std::string alternate_cs = ""; -- PointerHolderph; -+ std::shared_ptrph; - - #ifdef USE_LCMS1 - size_t profile_size; -@@ -481,7 +481,7 @@ QPDFObjectHandle embedIccProfile(QPDF &pdf) - cmsSaveProfileToMem(colorProfile, buff, &profile_size); - - // Write ICC profile buffer into PDF -- ph = new Buffer(buff, profile_size); -+ ph = std::shared_ptr(new Buffer(buff, profile_size)); - iccstream = QPDFObjectHandle::newStream(&pdf, ph); - iccstream.replaceDict(QPDFObjectHandle::newDictionary(streamdict)); - -@@ -605,7 +605,7 @@ QPDFObjectHandle getCalGrayArray(double wp[3], double - * O - std::vector of QPDFObjectHandle - * I - QPDF object - * I - number of strips per page -- * I - std::vector of PointerHolder containing data for each strip -+ * I - std::vector of std::shared_ptr containing data for each strip - * I - strip width - * I - strip height - * I - color space -@@ -613,7 +613,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips, - */ - std::vector - makePclmStrips(QPDF &pdf, unsigned num_strips, -- std::vector< PointerHolder > &strip_data, -+ std::vector< std::shared_ptr > &strip_data, - std::vector &compression_methods, - unsigned width, std::vector& strip_height, cups_cspace_t cs, unsigned bpc) - { -@@ -679,7 +679,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips, - Pl_Flate pflate("pflate", &psink, Pl_Flate::a_deflate); - pflate.write(strip_data[i]->getBuffer(), strip_data[i]->getSize()); - pflate.finish(); -- ret[i].replaceStreamData(PointerHolder(psink.getBuffer()), -+ ret[i].replaceStreamData(std::shared_ptr(psink.getBuffer()), - QPDFObjectHandle::newName("/FlateDecode"),QPDFObjectHandle::newNull()); - } - else if (compression == RLE_DECODE) -@@ -687,7 +687,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips, - Pl_RunLength prle("prle", &psink, Pl_RunLength::a_encode); - prle.write(strip_data[i]->getBuffer(),strip_data[i]->getSize()); - prle.finish(); -- ret[i].replaceStreamData(PointerHolder(psink.getBuffer()), -+ ret[i].replaceStreamData(std::shared_ptr(psink.getBuffer()), - QPDFObjectHandle::newName("/RunLengthDecode"),QPDFObjectHandle::newNull()); - } - else if (compression == DCT_DECODE) -@@ -695,7 +695,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips, - Pl_DCT pdct("pdct", &psink, width, strip_height[i], components, color_space); - pdct.write(strip_data[i]->getBuffer(),strip_data[i]->getSize()); - pdct.finish(); -- ret[i].replaceStreamData(PointerHolder(psink.getBuffer()), -+ ret[i].replaceStreamData(std::shared_ptr(psink.getBuffer()), - QPDFObjectHandle::newName("/DCTDecode"),QPDFObjectHandle::newNull()); - } - } -@@ -703,7 +703,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips, - } - #endif - --QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder page_data, unsigned width, -+QPDFObjectHandle makeImage(QPDF &pdf, std::shared_ptr page_data, unsigned width, - unsigned height, std::string render_intent, cups_cspace_t cs, unsigned bpc) - { - QPDFObjectHandle ret = QPDFObjectHandle::newStream(&pdf); -@@ -843,7 +843,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHoldergetBuffer(),page_data->getSize()); - pflate.finish(); - -- ret.replaceStreamData(PointerHolder(psink.getBuffer()), -+ ret.replaceStreamData(std::shared_ptr(psink.getBuffer()), - QPDFObjectHandle::newName("/FlateDecode"),QPDFObjectHandle::newNull()); - #else - ret.replaceStreamData(page_data,QPDFObjectHandle::newNull(),QPDFObjectHandle::newNull()); -@@ -857,7 +857,7 @@ void finish_page(struct pdf_info * info) - if (info->outformat == OUTPUT_FORMAT_PDF) - { - // Finish previous PDF Page -- if(!info->page_data.getPointer()) -+ if(!info->page_data.get()) - return; - - QPDFObjectHandle image = makeImage(info->pdf, info->page_data, info->width, info->height, info->render_intent, info->color_space, info->bpc); -@@ -874,7 +874,7 @@ void finish_page(struct pdf_info * info) - return; - - for (size_t i = 0; i < info->pclm_strip_data.size(); i ++) -- if(!info->pclm_strip_data[i].getPointer()) -+ if(!info->pclm_strip_data[i].get()) - return; - - std::vector strips = makePclmStrips(info->pdf, info->pclm_num_strips, info->pclm_strip_data, info->pclm_compression_method_preferred, info->width, info->pclm_strip_height, info->color_space, info->bpc); -@@ -932,7 +932,7 @@ void finish_page(struct pdf_info * info) - #endif - - // bookkeeping -- info->page_data = PointerHolder(); -+ info->page_data = std::shared_ptr(); - #ifdef QPDF_HAVE_PCLM - info->pclm_strip_data.clear(); - #endif -@@ -1101,12 +1101,12 @@ int add_pdf_page(struct pdf_info * info, int pagen, un - die("Page too big"); - } - if (info->outformat == OUTPUT_FORMAT_PDF) -- info->page_data = PointerHolder(new Buffer(info->line_bytes*info->height)); -+ info->page_data = std::shared_ptr(new Buffer(info->line_bytes*info->height)); - else if (info->outformat == OUTPUT_FORMAT_PCLM) - { - // reserve space for PCLm strips - for (size_t i = 0; i < info->pclm_num_strips; i ++) -- info->pclm_strip_data[i] = PointerHolder(new Buffer(info->line_bytes*info->pclm_strip_height[i])); -+ info->pclm_strip_data[i] = std::shared_ptr(new Buffer(info->line_bytes*info->pclm_strip_height[i])); - } - - QPDFObjectHandle page = QPDFObjectHandle::parse( ---- filter/urftopdf.cpp.orig 2023-01-25 01:41:08 UTC -+++ filter/urftopdf.cpp -@@ -80,7 +80,7 @@ struct pdf_info - unsigned pixel_bytes; - unsigned line_bytes; - unsigned bpp; -- PointerHolder page_data; -+ std::shared_ptr page_data; - double page_width,page_height; - }; - -@@ -119,7 +119,7 @@ enum ColorSpace { - iprintf("Created temporary file '%s'\n", tempfile_name); - */ - --QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder page_data, unsigned width, unsigned height, ColorSpace cs, unsigned bpc) -+QPDFObjectHandle makeImage(QPDF &pdf, std::shared_ptr page_data, unsigned width, unsigned height, ColorSpace cs, unsigned bpc) - { - QPDFObjectHandle ret = QPDFObjectHandle::newStream(&pdf); - -@@ -153,7 +153,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder>] ?? -- ret.replaceStreamData(PointerHolder(psink.getBuffer()), -+ ret.replaceStreamData(std::shared_ptr(psink.getBuffer()), - QPDFObjectHandle::newName("/FlateDecode"),QPDFObjectHandle::newNull()); - #else - ret.replaceStreamData(page_data,QPDFObjectHandle::newNull(),QPDFObjectHandle::newNull()); -@@ -165,7 +165,7 @@ void finish_page(struct pdf_info * info) - void finish_page(struct pdf_info * info) - { - //Finish previous Page -- if(!info->page_data.getPointer()) -+ if(!info->page_data.get()) - return; - - QPDFObjectHandle image = makeImage(info->pdf, info->page_data, info->width, info->height, DEVICE_RGB, 8); -@@ -182,7 +182,7 @@ void finish_page(struct pdf_info * info) - info->page.getKey("/Contents").replaceStreamData(content,QPDFObjectHandle::newNull(),QPDFObjectHandle::newNull()); - - // bookkeeping -- info->page_data = PointerHolder(); -+ info->page_data = std::shared_ptr(); - } - - int add_pdf_page(struct pdf_info * info, int pagen, unsigned width, unsigned height, int bpp, unsigned dpi) -@@ -199,7 +199,7 @@ int add_pdf_page(struct pdf_info * info, int pagen, un - if (info->height > (std::numeric_limits::max() / info->line_bytes)) { - die("Page too big"); - } -- info->page_data = PointerHolder(new Buffer(info->line_bytes*info->height)); -+ info->page_data = std::shared_ptr(new Buffer(info->line_bytes*info->height)); - - QPDFObjectHandle page = QPDFObjectHandle::parse( - "<<"