From 9fbfd67260a0c209eb44ccb154c9388d1d5b0130 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 19 Aug 2026 20:19:59 +0200 Subject: [PATCH] Backport an upstream patch to fix printing PDFs Resolves: RHEL-194040 --- 595.patch | 34 ++++++++++++++++++++++++++++++++++ cairo.spec | 11 ++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 595.patch diff --git a/595.patch b/595.patch new file mode 100644 index 0000000..ed1056a --- /dev/null +++ b/595.patch @@ -0,0 +1,34 @@ +From f19e2fe080ddcfce93c8234a919fd882f3d63362 Mon Sep 17 00:00:00 2001 +From: Adrian Johnson +Date: Fri, 13 Sep 2024 06:28:39 +0930 +Subject: [PATCH] cff: Don't fail if no local subs + +Fixes: #870 +--- + src/cairo-cff-subset.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c +index 076cb2b0a..8a7de0065 100644 +--- a/src/cairo-cff-subset.c ++++ b/src/cairo-cff-subset.c +@@ -952,9 +952,13 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t *font, + decode_number (operand, nominal_width); + + num_subs = _cairo_array_num_elements (local_sub_index); +- *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t)); +- if (unlikely (*local_subs_used == NULL)) +- return _cairo_error (CAIRO_STATUS_NO_MEMORY); ++ if (num_subs > 0) { ++ *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t)); ++ if (unlikely (*local_subs_used == NULL)) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); ++ } else { ++ *local_subs_used = NULL; ++ } + + if (num_subs < 1240) + *local_sub_bias = 107; +-- +GitLab + diff --git a/cairo.spec b/cairo.spec index b0da225..0503725 100644 --- a/cairo.spec +++ b/cairo.spec @@ -4,7 +4,7 @@ Name: cairo Version: 1.18.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A 2D graphics library License: LGPL-2.1-only OR MPL-1.1 @@ -12,6 +12,11 @@ URL: https://cairographics.org Source: https://cairographics.org/releases/%{name}-%{version}.tar.xz Patch: cairo-multilib.patch +# Fix printing PDFs +# https://bugzilla.redhat.com/show_bug.cgi?id=2330100 +# Backported from upstream +# https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/595 +Patch: 595.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -155,6 +160,10 @@ This package contains tools for working with the cairo graphics library. %{_libdir}/cairo/ %changelog +* Wed Aug 19 2026 Benjamin Otte - 1.18.2-3 +- Backport an upstream patch to fix printing PDFs +- Resolves: RHEL-194040 + * Tue Oct 29 2024 Troy Dawson - 1.18.2-2 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018