public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libcupsfilters] rawhide: fix pclmtoraster issues found in CI, 2.2.1 (fedora#2513920)
@ 2026-08-12  6:34 Zdenek Dohnal
  0 siblings, 0 replies; only message in thread
From: Zdenek Dohnal @ 2026-08-12  6:34 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libcupsfilters
Branch : rawhide
Commit : a1425a0430a6a4471f78bc0ce28a4e2c811a4a8e
Author : Zdenek Dohnal <zdohnal@redhat.com>
Date   : 2026-08-12T08:34:18+02:00
Stats  : +224/-313 in 8 file(s)
URL    : https://src.fedoraproject.org/rpms/libcupsfilters/c/a1425a0430a6a4471f78bc0ce28a4e2c811a4a8e?branch=rawhide

Log:
fix pclmtoraster issues found in CI, 2.2.1 (fedora#2513920)

---
diff --git a/0001-Fix-2.2.0-test-packaging-and-CUPS-datadir-detection-.patch b/0001-Fix-2.2.0-test-packaging-and-CUPS-datadir-detection-.patch
deleted file mode 100644
index 4622ea9..0000000
--- a/0001-Fix-2.2.0-test-packaging-and-CUPS-datadir-detection-.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index 94b3692..fc96476 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -92,8 +92,7 @@ lib_LTLIBRARIES = libcupsfilters.la
- 
- check_SCRIPTS = \
- 	cupsfilters/testfilters.sh \
--	cupsfilters/test-pclm-overflow.sh \
--	cupsfilters/test-pdftoraster-copy-height.sh
-+	cupsfilters/test-pclm-overflow.sh
- 
- check_PROGRAMS = \
- 	testcmyk \
-@@ -116,8 +115,7 @@ TESTS = \
- 	test-pdf \
- 	test-ps \
- 	cupsfilters/testfilters.sh \
--	cupsfilters/test-pclm-overflow.sh \
--	cupsfilters/test-pdftoraster-copy-height.sh
-+	cupsfilters/test-pclm-overflow.sh
- 
- #	testcmyk # fails as it opens some image.ppm which is nowerhe to be found.
- #	testimage # requires also some ppm file as argument
-diff --git a/configure.ac b/configure.ac
-index 7ef2a37..b4103f0 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -79,7 +79,14 @@ AS_IF([$PKGCONFIG --exists cups3], [
-     AC_SUBST(CUPS_CFLAGS)
-     AC_SUBST(CUPS_LIBS)
- 
--    CUPS_DATADIR="$($PKGCONFIG --variable=prefix cups3)/share/cups"
-+    # Prefer the datadir cups3.pc exports directly.  Reconstructing it from
-+    # --variable=prefix is wrong when CUPS was built with an architecture-
-+    # specific prefix (e.g. /usr/x86_64-pc-linux-gnu): the data lives in the
-+    # arch-independent /usr/share/cups, which the .pc records in cups_datadir.
-+    # Fall back to the prefix-relative path for a .pc without it. (#201)
-+    CUPS_DATADIR="$($PKGCONFIG --variable=cups_datadir cups3)"
-+    AS_IF([test "x$CUPS_DATADIR" = x],
-+          [CUPS_DATADIR="$($PKGCONFIG --variable=prefix cups3)/share/cups"])
-     AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR", [CUPS datadir])
-     AC_SUBST(CUPS_DATADIR)
- 
-@@ -128,7 +135,14 @@ AS_IF([$PKGCONFIG --exists cups3], [
- 	cups_prefix="$($PKGCONFIG --variable=prefix cups)"
- 	AS_IF([test "x$cups_prefix" = x], [cups_prefix=/usr])
- 
--	CUPS_DATADIR="$cups_prefix/share/cups"
-+	# Prefer the datadir cups.pc exports directly.  Reconstructing it from
-+	# --variable=prefix is wrong when CUPS was built with an architecture-
-+	# specific prefix (e.g. /usr/x86_64-pc-linux-gnu): the data lives in the
-+	# arch-independent /usr/share/cups, which the .pc records in cups_datadir.
-+	# Fall back to the prefix-relative path for a .pc without it. (#201)
-+	CUPS_DATADIR="$($PKGCONFIG --variable=cups_datadir cups)"
-+	AS_IF([test "x$CUPS_DATADIR" = x],
-+	      [CUPS_DATADIR="$cups_prefix/share/cups"])
- 	AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR", [CUPS datadir])
- 	AC_SUBST(CUPS_DATADIR)
- 
-diff --git a/cupsfilters/test-pclm-overflow.sh b/cupsfilters/test-pclm-overflow.sh
-index 9269510..c7c003e 100755
---- a/cupsfilters/test-pclm-overflow.sh
-+++ b/cupsfilters/test-pclm-overflow.sh
-@@ -7,6 +7,17 @@ LIBTOOL="${BUILD_ROOT}/libtool"
- CC="${CC:-cc}"
- SAN_FLAGS="${SAN_FLAGS:--fsanitize=address -fno-omit-frame-pointer}"
- 
-+# AddressSanitizer is what makes this test meaningful.  When libasan is not
-+# installed the compiler still accepts -fsanitize=address but the link fails
-+# (missing libasan_preinit.o / -lasan) -- that is an environment gap, not a
-+# libcupsfilters bug.  Skip (Automake exit 77) instead of failing; a real
-+# failure is reported only when ASan IS available and the sanitizer fires.
-+if ! printf 'int main(void){return 0;}\n' \
-+     | "${CC}" ${SAN_FLAGS} -x c - -o /dev/null >/dev/null 2>&1; then
-+  echo "AddressSanitizer not available (cannot link ${SAN_FLAGS}); skipping." >&2
-+  exit 77
-+fi
-+
- if [[ ! -x "${LIBTOOL}" ]]; then
-   echo "libtool helper not found at ${LIBTOOL}" >&2
-   exit 99
-diff --git a/cupsfilters/test-pdftoraster-copy-height.sh b/cupsfilters/test-pdftoraster-copy-height.sh
-deleted file mode 100755
-index 3455ef1..0000000
---- a/cupsfilters/test-pdftoraster-copy-height.sh
-+++ /dev/null
-@@ -1,16 +0,0 @@
--#!/usr/bin/env bash
--#
--# Test that pdftoraster copy_height fix works correctly.
--# This reproduces the off-by-one logic without needing ASan.
--set -euo pipefail
--
--SRC="$(dirname "$0")/test-pdftoraster-copy-height.c"
--BIN="/tmp/test-pdftoraster-copy-height"
--
--# Compile if needed
--if [ ! -x "$BIN" ] || [ "$SRC" -nt "$BIN" ]; then
--  "${CC:-cc}" -std=c11 -O0 -g -Wall -Wextra \
--    "$SRC" -o "$BIN"
--fi
--
--exec "$BIN"

diff --git a/0001-Makefile.am-Ensure-gen-lorem-text-test-supports-out-.patch b/0001-Makefile.am-Ensure-gen-lorem-text-test-supports-out-.patch
deleted file mode 100644
index fed2ea1..0000000
--- a/0001-Makefile.am-Ensure-gen-lorem-text-test-supports-out-.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From e6dccfc6e7b608a1bf0c0e2db0da0b02c6463649 Mon Sep 17 00:00:00 2001
-From: Tom Pollard <tom_pollard@hotmail.co.uk>
-Date: Fri, 7 Aug 2026 19:27:32 +0100
-Subject: [PATCH] Makefile.am: Ensure gen-lorem-text test supports out of tree
- builds (#205)
-
-For out of tree builds, the target directory needs to exist for the
-generator to write the file to, fixes:
-
-```
-./gen-lorem-text > cupsfilters/test_files/test_text_lorem.txt
-/bin/sh: line 1: cupsfilters/test_files/test_text_lorem.txt: No such file or directory
-```
----
- Makefile.am | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Makefile.am b/Makefile.am
-index e2238320..175d1ef1 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -348,6 +348,7 @@ BUILT_SOURCES = cupsfilters/test_files/test_text_lorem.txt
- CLEANFILES   = cupsfilters/test_files/test_text_lorem.txt
- 
- cupsfilters/test_files/test_text_lorem.txt: gen-lorem-text
-+	$(MKDIR_P) $(@D)
- 	$(AM_V_GEN)./gen-lorem-text > $@
- 
- EXTRA_DIST += \
--- 
-2.55.0
-

diff --git a/0001-configure.ac-Drop-mandatory-C-compiler.patch b/0001-configure.ac-Drop-mandatory-C-compiler.patch
deleted file mode 100644
index 85feea7..0000000
--- a/0001-configure.ac-Drop-mandatory-C-compiler.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 08f747f2438ce302b94c1c96e77c15e6eef1c515 Mon Sep 17 00:00:00 2001
-From: Zdenek Dohnal <zdohnal@redhat.com>
-Date: Thu, 6 Aug 2026 15:11:01 +0200
-Subject: [PATCH] configure.ac: Drop mandatory C++ compiler
-
-We no longer compile C++ in libcupsfilters, do not require it during
-configure.
----
- configure.ac | 8 +-------
- 1 file changed, 1 insertion(+), 7 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 88df4f7e..19abc88a 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -19,7 +19,7 @@ m4_include([m4/ax_compare_version.m4])
- m4_include([m4/basic-directories.m4])
- AM_INIT_AUTOMAKE([1.11 gnu dist-xz dist-bzip2 subdir-objects foreign])
- AM_SILENT_RULES([yes])
--AC_LANG([C++])
-+AC_LANG([C])
- AC_CONFIG_HEADERS([config.h])
- # Extra defines for the config.h
- AH_BOTTOM([
-@@ -50,11 +50,8 @@ AH_BOTTOM([
- # Find required base packages
- # ===========================
- AC_PROG_CC
--AC_PROG_CXX
--AX_CXX_COMPILE_STDCXX([11],[noext],[mandatory])
- AM_PROG_CC_C_O
- AM_ICONV
--AC_PROG_CPP
- AC_PROG_INSTALL
- AC_PROG_LN_S
- AC_PROG_MAKE_SET
-@@ -566,10 +563,8 @@ AS_IF([test x"$enable_werror" = "xyes"], [
- AS_IF([test x"$GCC" = "xyes"], [
- 	# Be tough with warnings and produce less careless code
- 	CFLAGS="$CFLAGS -Wall -std=gnu11"
--	CXXFLAGS="$CXXFLAGS -Wall " # -Weffc++" # TODO: enable when it does not print 1MB of warnings
- ])
- CFLAGS="$CFLAGS -D_GNU_SOURCE"
--CXXFLAGS="$CXXFLAGS -std=c++17"
- 
- # =========
- # CJK FONTS
-@@ -601,7 +596,6 @@ AC_MSG_NOTICE([
- ==============================================================================
- Environment settings:
- 	CFLAGS:                                    ${CFLAGS}
--	CXXFLAGS:                                  ${CXXFLAGS}
- 	LDFLAGS:                                   ${LDFLAGS}
- Build configuration:
-         libcups:         ${CUPS_VERSION}
--- 
-2.55.0
-

diff --git a/0001-configure.ac-Remove-poppler-cpp-remaining-code.patch b/0001-configure.ac-Remove-poppler-cpp-remaining-code.patch
deleted file mode 100644
index 3a7c604..0000000
--- a/0001-configure.ac-Remove-poppler-cpp-remaining-code.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 27ccf46b5bfd9170eb072c428440d3fc76daa8eb Mon Sep 17 00:00:00 2001
-From: Zdenek Dohnal <zdohnal@redhat.com>
-Date: Thu, 6 Aug 2026 16:00:48 +0200
-Subject: [PATCH] configure.ac: Remove poppler-cpp remaining code
-
-pdftoraster uses pdfio now as well, so poppler-cpp is not needed
-anymore.
----
- Makefile.am             |  5 -----
- configure.ac            | 12 ------------
- cupsfilters/universal.c | 10 ++++------
- 3 files changed, 4 insertions(+), 23 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index f0b098f8..f4d5c3af 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -214,10 +214,6 @@ libcupsfilters_la_LIBADD = \
- 	$(LIBPNG_LIBS) \
- 	$(TIFF_LIBS) \
- 	-lm
--if ENABLE_POPPLER
--libcupsfilters_la_LIBADD += \
--	$(POPPLER_LIBS)
--endif
- libcupsfilters_la_CFLAGS = \
- 	-I$(srcdir)/cupsfilters/fontembed/ \
- 	$(FONTCONFIG_CFLAGS) \
-@@ -235,7 +231,6 @@ libcupsfilters_la_LDFLAGS = \
- 	$(LIBJXL_LIBS)
- if BUILD_DBUS
- libcupsfilters_la_CFLAGS += $(DBUS_CFLAGS) -DHAVE_DBUS
--libcupsfilters_la_CXXFLAGS = -std=c++11 $(libcupsfilters_la_CFLAGS)   # -std=c++11
- libcupsfilters_la_LIBADD += $(DBUS_LIBS)
- endif
- 
-diff --git a/configure.ac b/configure.ac
-index 19abc88a..7ef2a37a 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -373,18 +373,6 @@ AS_IF([test x"$with_fontconfig" != "xno" && test "x$enable_texttopdf" != "xno"],
- PKG_CHECK_MODULES([LIBPDFIO], [pdfio >= 1.6.4])
- 
- 
--# =================
--# Check for Poppler
--# =================
--AC_ARG_ENABLE(poppler, AS_HELP_STRING([--enable-poppler],[enable Poppler-based filters]),
--	      enable_poppler=$enableval,enable_poppler=yes)
--AM_CONDITIONAL([ENABLE_POPPLER], test x$enable_poppler = xyes)
--if test x$enable_poppler = xyes; then
--	PKG_CHECK_MODULES([POPPLER], [poppler-cpp >= 0.19])
--	AC_CHECK_HEADER([poppler/cpp/poppler-version.h], [AC_DEFINE([HAVE_CPP_POPPLER_VERSION_H],[1],[Define if you have Poppler's "cpp/poppler-version.h" header file.])], [])
--	AC_DEFINE([HAVE_POPPLER], [1], [Define that we provide Poppler library])
--fi
--
- # ===============
- # Check for D-Bus
- # ===============
-diff --git a/cupsfilters/universal.c b/cupsfilters/universal.c
-index 0e7251f7..69488741 100644
---- a/cupsfilters/universal.c
-+++ b/cupsfilters/universal.c
-@@ -270,7 +270,7 @@ cfFilterUniversal(int inputfd,		// I - File descriptor input stream
- 		     "cfFilterUniversal: Adding %s to chain", filter->name);
-       }
- 
--#if defined(HAVE_GHOSTSCRIPT) || defined(HAVE_POPPLER)
-+#if defined(HAVE_GHOSTSCRIPT)
-       if (strcasecmp(output_type, "vnd.cups-pdf"))
-       {
- 	if (!strcasecmp(output_type, "vnd.cups-raster") ||
-@@ -296,7 +296,6 @@ cfFilterUniversal(int inputfd,		// I - File descriptor input stream
- 		       "cfFilterUniversal: Adding %s to chain",
- 		       filter->name);
- #  else
--#    ifdef HAVE_POPPLER
- 	  filter = malloc(sizeof(cf_filter_filter_in_chain_t));
- 	  filter->function = cfFilterPDFToRaster;
- 	  filter->parameters = NULL;
-@@ -317,19 +316,18 @@ cfFilterUniversal(int inputfd,		// I - File descriptor input stream
- 	    if (log) log(ld, CF_LOGLEVEL_DEBUG,
- 			 "cfFilterUniversal: Adding %s to chain", filter->name);
- 	  }
--#    endif // HAVE_POPPLER
- #  endif // HAVE_GHOSTSCRIPT
- 	}
- 	else
- 	{
--#endif // HAVE_GHOSTSCRIPT || HAVE_POPPLER
-+#endif // HAVE_GHOSTSCRIPT
- 	  // Output format is not PDF and unknown -> Error
- 	  ret = 1;
- 	  goto out;
--#if defined(HAVE_GHOSTSCRIPT) || defined(HAVE_POPPLER)
-+#if defined(HAVE_GHOSTSCRIPT)
- 	}
-       }
--#endif // HAVE_GHOSTSCRIPT || HAVE_POPPLER
-+#endif // HAVE_GHOSTSCRIPT
-     }
-   }
- 
--- 
-2.55.0
-

diff --git a/0001-pclmtoraster.c-Fix-getting-MediaBox-from-input.patch b/0001-pclmtoraster.c-Fix-getting-MediaBox-from-input.patch
new file mode 100644
index 0000000..deeb290
--- /dev/null
+++ b/0001-pclmtoraster.c-Fix-getting-MediaBox-from-input.patch
@@ -0,0 +1,78 @@
+From 209cae2445ec4b9770d6419ce7be844d5ec1ed16 Mon Sep 17 00:00:00 2001
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Tue, 11 Aug 2026 13:14:30 +0200
+Subject: [PATCH] pclmtoraster.c: Fix getting MediaBox from input
+
+The affected function had logic inverted - error handling happened when
+MediaBox was found - which caused no output was generated.
+
+The PR fixes it and adds logic to get MediaBox from parent object,
+because per PDF specification MediaBox can be inherited from parent.
+
+Assisted-By: Claude Code
+---
+ cupsfilters/pclmtoraster.c | 42 ++++++++++++++++++++++++--------------
+ 1 file changed, 27 insertions(+), 15 deletions(-)
+
+diff --git a/cupsfilters/pclmtoraster.c b/cupsfilters/pclmtoraster.c
+index 896dbc2b..62c74768 100644
+--- a/cupsfilters/pclmtoraster.c
++++ b/cupsfilters/pclmtoraster.c
+@@ -210,27 +210,39 @@ parse_opts(cf_filter_data_t *data,			// I - Job and Print data
+ }
+ 
+ //
+-// 'media_box_lookup()' - Helper function look up MediaBox from PDF dictionary
++// 'media_box_lookup()' - Helper function to look up MediaBox from a page
++//                        object, walking parent nodes if needed (MediaBox is
++//                        an inheritable attribute in PDF).
+ //
+ 
+-static bool					  // O - 1 if mediabox is found, 0 if not
+-media_box_lookup(pdfio_obj_t *object,		// I - Page Object to look for mediabox
+-	       	 float rect[4])			// O - rectangle for mediabox output
++static bool					// O - true if found, false if not
++media_box_lookup(pdfio_obj_t *object,		// I - Page object
++		 float rect[4])			// O - MediaBox rectangle
+ {
+-  pdfio_rect_t mediaBox;
+-  pdfio_dict_t *object_dict = pdfioObjGetDict(object);
+-  if(pdfioDictGetRect(object_dict, "MediaBox", &mediaBox))
+-    return false;
++  pdfio_rect_t	mediaBox;			// MediaBox value
++  pdfio_dict_t	*dict;				// Current dictionary
+ 
+- pdfioDictGetRect(object_dict, "MediaBox", &mediaBox);
++  // Walk the page tree up through Parent nodes to find an inherited MediaBox
++  while (object)
++  {
++    dict = pdfioObjGetDict(object);
++    if (!dict)
++      break;
+ 
+- rect[0] = mediaBox.x1;
+- rect[1] = mediaBox.y1;
+- rect[2] = mediaBox.x2;
+- rect[3] = mediaBox.y2;
++    if (pdfioDictGetRect(dict, "MediaBox", &mediaBox))
++    {
++      rect[0] = mediaBox.x1;
++      rect[1] = mediaBox.y1;
++      rect[2] = mediaBox.x2;
++      rect[3] = mediaBox.y2;
++      return (true);
++    }
+ 
+- return true;
+-}	
++    object = pdfioDictGetObj(dict, "Parent");
++  }
++
++  return (false);
++}
+ 
+ //
+ // 'rotate_bitmap()' - Function to rotate a bitmap
+-- 
+2.55.0
+

diff --git a/0001-pclmtoraster.c-Fix-processing-image-in-PCLm.patch b/0001-pclmtoraster.c-Fix-processing-image-in-PCLm.patch
new file mode 100644
index 0000000..ad291ac
--- /dev/null
+++ b/0001-pclmtoraster.c-Fix-processing-image-in-PCLm.patch
@@ -0,0 +1,137 @@
+From 98423c1bedb0a4d39ed9096c653fe91787664a0a Mon Sep 17 00:00:00 2001
+From: Zdenek Dohnal <zdohnal@redhat.com>
+Date: Tue, 11 Aug 2026 16:23:57 +0200
+Subject: [PATCH] pclmtoraster.c: Fix processing image in PCLm
+
+Fixed several issues in PCLm processing
+
+1. The input PCLm might not have /Type set for images, because it is
+optional key, filter has to look for subtype Image (fixed typo image ->
+Image).
+
+2. PDFIO read stream function can return -1, so it has to be saved in
+ssize_t to get correct interpretation - otherwise the filter aborts on
+alloc of large number.
+
+3. buffer was array of pointers to char instead of array of chars -
+saves memory
+
+4. making code straight, adding return value checks, grouping local vars
+at the beginning
+
+Assisted-By: Claude Code by Anthropic
+---
+ cupsfilters/pclmtoraster.c | 79 +++++++++++++++++++++++---------------
+ 1 file changed, 49 insertions(+), 30 deletions(-)
+
+diff --git a/cupsfilters/pclmtoraster.c b/cupsfilters/pclmtoraster.c
+index 62c74768..d1ca9014 100644
+--- a/cupsfilters/pclmtoraster.c
++++ b/cupsfilters/pclmtoraster.c
+@@ -851,40 +851,65 @@ process_image(pdfio_dict_t *dict, 		// I - dictionary where images are there
+ 	      const char *key, 			// I - key names of xobjects
+ 	      void *cb_data)			// I - conversion data
+ {
+-  pclmtoraster_data_t *data = (pclmtoraster_data_t *)cb_data;
+-  char *buffer[4096];
+-  pdfio_obj_t *image = pdfioDictGetObj(dict, key);
++  const char          *subtype;
++  pclmtoraster_data_t *data;
++  pdfio_obj_t         *image;
++  pdfio_dict_t        *imgdict;
++  pdfio_stream_t      *img_str;
++  ssize_t             bytes;
++  unsigned char       buffer[8192];
+ 
+-  if (strcmp(pdfioObjGetType(image), "image") == 0)
+-  {
+-    pdfio_dict_t *imgdict = pdfioObjGetDict(image);
+-    if (!imgdict)
+-       return true;
+ 
+-    // Read the raw image stream
+-    pdfio_stream_t *img_str = pdfioObjOpenStream(image, true);
+-    size_t bufsize = pdfioStreamRead(img_str, buffer, sizeof(buffer));
++  data = (pclmtoraster_data_t *)cb_data;
++
++  if ((image = pdfioDictGetObj(dict, key)) == NULL)
++    return (true);
++
++  if ((subtype = pdfioObjGetSubtype(image)) == NULL)
++    return (true);
++
++  if (strcmp(subtype, "Image"))
++    return (true);
+ 
+-    int width = pdfioDictGetNumber(imgdict, "Width");
+-    int height = pdfioDictGetNumber(imgdict, "Height");
++  if ((imgdict = pdfioObjGetDict(image)) == NULL)
++    return (true);
+ 
+-    data->header.cupsHeight += height;
++  int width = (int)pdfioDictGetNumber(imgdict, "Width");
++  int height = (int)pdfioDictGetNumber(imgdict, "Height");
++
++  // Read the complete decoded image stream
++  if ((img_str = pdfioObjOpenStream(image, true)) == NULL)
++    return (true);
++
++  while ((bytes = pdfioStreamRead(img_str, buffer, sizeof(buffer))) > 0)
++  {
++    unsigned char *tmp;
+ 
+-    // Allocate memory for the bitmap data
+     if (data->pixel_count == 0)
+-      data->bitmap = (unsigned char *)malloc(bufsize);
++      tmp = (unsigned char *)malloc(bytes);
+     else
+-      data->bitmap = (unsigned char *)realloc(data->bitmap,
+-                                              data->pixel_count + bufsize);
++      tmp = (unsigned char *)realloc(data->bitmap,
++            data->pixel_count + bytes);
+ 
+-    memcpy(data->bitmap + data->pixel_count, buffer, bufsize);
+-    data->pixel_count += bufsize;
++    if (!tmp)
++    {
++      pdfioStreamClose(img_str);
++      return (false);
++    }
+ 
+-    // Track maximum width
+-    if (width > data->header.cupsWidth)
+-      data->header.cupsWidth = width;
++    data->bitmap = tmp;
++    memcpy(data->bitmap + data->pixel_count, buffer, bytes);
++    data->pixel_count += bytes;
+   }
+ 
++  pdfioStreamClose(img_str);
++
++  data->header.cupsHeight += height;
++
++  // Track maximum width
++  if (width > (int)data->header.cupsWidth)
++    data->header.cupsWidth = width;
++
+   return (true);
+ }
+ 
+@@ -1297,13 +1322,7 @@ cfFilterPCLmToRaster(int inputfd,         // I - File descriptor input stream
+ 
+     if (log) log(ld, CF_LOGLEVEL_INFO,
+ 		 "cfFilterPCLmToRaster: Starting page %d.", i + 1);
+-    if (out_page(raster, pages, i, log, ld, &pclmtoraster_data,data,
+-		 &convert) != 0)
+-      break;
+-
+-    if (log) log(ld, CF_LOGLEVEL_INFO,
+-		 "cfFilterPCLmToRaster: Starting page %d.", (i + 1));
+-    if (out_page(raster, pages, i, log, ld, &pclmtoraster_data,data,
++    if (out_page(raster, pages, i, log, ld, &pclmtoraster_data, data,
+ 		 &convert) != 0)
+       break;
+   }
+-- 
+2.55.0
+

diff --git a/libcupsfilters.spec b/libcupsfilters.spec
index 513c9d0..5d9f93f 100644
--- a/libcupsfilters.spec
+++ b/libcupsfilters.spec
@@ -1,12 +1,12 @@
 %global _hardened_build 1
 
-%global upstream_version 2.2.0
+%global upstream_version 2.2.1
 
 %bcond jpegxl %{undefined rhel}
 
 Name: libcupsfilters
 Epoch: 1
-Version: 2.2.0
+Version: 2.2.1
 Release: 1%{?dist}
 Summary: Library for developing printing filters
 # the CUPS exception text is the same as LLVM exception, so using that name with
@@ -16,16 +16,9 @@ License: Apache-2.0 WITH LLVM-exception
 URL: https://github.com/OpenPrinting/libcupsfilters
 Source0: %{URL}/releases/download/%{version}/%{name}-%{version}.tar.gz
 
-# https://github.com/OpenPrinting/libcupsfilters/pull/202
-# drop unneeded poppler-cpp and c++ dpes
-Patch001: 0001-configure.ac-Drop-mandatory-C-compiler.patch
-Patch002: 0001-configure.ac-Remove-poppler-cpp-remaining-code.patch
-# https://github.com/OpenPrinting/libcupsfilters/pull/204/
-# Fix running regression tests - one is skipped, other removed
-Patch003: 0001-Fix-2.2.0-test-packaging-and-CUPS-datadir-detection-.patch
-# https://github.com/OpenPrinting/libcupsfilters/commit/e6dccfc6e7b60
-# support out of tree builds
-Patch004: 0001-Makefile.am-Ensure-gen-lorem-text-test-supports-out-.patch
+# https://github.com/OpenPrinting/libcupsfilters/pull/208
+Patch001: 0001-pclmtoraster.c-Fix-getting-MediaBox-from-input.patch
+Patch002: 0001-pclmtoraster.c-Fix-processing-image-in-PCLm.patch
 
 
 # for generating configure and Makefile scripts in autogen.h
@@ -211,6 +204,9 @@ rm -f %{buildroot}%{_pkgdocdir}/{LICENSE,COPYING,NOTICE}
 
 
 %changelog
+* Tue Aug 11 2026 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.1-1
+- fix pclmtoraster issues found in CI, 2.2.1 (fedora#2513920)
+
 * Thu Aug 06 2026 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.0-1
 - libcupsfilters-2.2.0 is available (fedora#2511889)
 

diff --git a/sources b/sources
index 3b54946..dd91d5c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (libcupsfilters-2.2.0.tar.gz) = 69ab4702fffc662fa19ec29c635e21b76fc05dd0e2a53db889b58709cd6b0f2f3d62307ef8ea0e1bae5715972bdcca33efb9f7af270ec2074749e47f6d43a302
+SHA512 (libcupsfilters-2.2.1.tar.gz) = 9d4b34cd56fa9d6ad1307779458e231e5474fc046edb298d13ba9037574ed91a1ed2f13d479ab0028e1d213dfba867917c503cb926b9e605f74a29037ac026f0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-12  6:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-12  6:34 [rpms/libcupsfilters] rawhide: fix pclmtoraster issues found in CI, 2.2.1 (fedora#2513920) Zdenek Dohnal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox