diff --git a/639.patch b/639.patch new file mode 100644 index 0000000..6ed178b --- /dev/null +++ b/639.patch @@ -0,0 +1,34 @@ +From 2771f621ed31deeae6c7ad984db1e5aa33f08a3c Mon Sep 17 00:00:00 2001 +From: oreo639 +Date: Thu, 22 Sep 2022 16:12:37 -0700 +Subject: [PATCH] layout: Fix crash when no font is installed + +Fixes: https://gitlab.gnome.org/GNOME/pango/-/issues/701 +--- + pango/pango-layout.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/pango/pango-layout.c b/pango/pango-layout.c +index a1c472039..b8eeede00 100644 +--- a/pango/pango-layout.c ++++ b/pango/pango-layout.c +@@ -5707,13 +5707,14 @@ pango_layout_run_get_extents_and_height (PangoLayoutRun *run, + } + else + { +- double xscale, yscale; ++ double xscale = 0, yscale = 0; + + if (!metrics) + metrics = pango_font_get_metrics (run->item->analysis.font, + run->item->analysis.language); + +- pango_font_get_scale_factors (run->item->analysis.font, &xscale, &yscale); ++ if (G_LIKELY(run->item->analysis.font)) ++ pango_font_get_scale_factors (run->item->analysis.font, &xscale, &yscale); + *height = pango_font_metrics_get_height (metrics) * MAX (xscale, yscale); + } + } +-- +GitLab + diff --git a/pango.changes b/pango.changes index ed51871..e61dcf0 100644 --- a/pango.changes +++ b/pango.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Sep 25 20:07:33 UTC 2022 - Bjørn Lie + +- Add 639.patch: layout: Fix crash when no font is installed. + ------------------------------------------------------------------- Fri Sep 16 16:59:29 UTC 2022 - Bjørn Lie diff --git a/pango.spec b/pango.spec index b3fc920..3e94e5a 100644 --- a/pango.spec +++ b/pango.spec @@ -26,6 +26,8 @@ URL: https://pango.gnome.org/ Source0: %{name}-%{version}.tar.xz Source2: macros.pango Source99: baselibs.conf +# PATCH-FIX-UPSTREAM 639.patch -- layout: Fix crash when no font is installed +Patch0: https://gitlab.gnome.org/GNOME/pango/-/merge_requests/639.patch BuildRequires: gcc-c++ BuildRequires: help2man @@ -117,7 +119,7 @@ This package contains all necessary include files and libraries needed to develop applications that require these. %prep -%setup +%autosetup -p1 %build %meson \