diff --git a/xscreensaver-5.32-0008-pick_font_1-rescue-when-XftFontOpenXlfd-fails-correc.patch b/xscreensaver-5.32-0008-pick_font_1-rescue-when-XftFontOpenXlfd-fails-correc.patch new file mode 100644 index 0000000..6e63de0 --- /dev/null +++ b/xscreensaver-5.32-0008-pick_font_1-rescue-when-XftFontOpenXlfd-fails-correc.patch @@ -0,0 +1,65 @@ +From 0b4338153d05894fcec22ed8791ec7c6c740e6b8 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Fri, 27 Feb 2015 15:09:40 +0900 +Subject: [PATCH] pick_font_1: rescue when XftFontOpenXlfd fails correctly + +https://bugzilla.redhat.com/show_bug.cgi?id=1195437 + +Backtrace: +#0 XftCharIndex (dpy=dpy@entry=0x1954b30, pub=pub@entry=0x0, ucs4=77) at xftglyphs.c:836 +#1 0x00000035dec0a918 in XftTextExtentsUtf8 (dpy=0x1954b30, pub=0x0, string=0x40b91c "M", len=1, extents=0x7fff1affef50) at xftextent.c:234 +#2 0x0000000000404d13 in pick_font_1 (s=, se=) at ../../hacks/fontglide.c:408 +#3 0x00000000004068a4 in fontglide_draw (dpy=, window=, closure=) at ../../hacks/fontglide.c:457 +#4 0x0000000000403750 in run_screenhack_table (ft=0x60e4a0 , anim_state=0x0, window2=0, window=39845890, +#5 main (argc=1, argv=) at ../../hacks/screenhack.c:965 + +While I don't know the real cause why XftFontOpenXlfd() +fails (and so se->xftfont is NULL here), anyway we should +handle this case correctly. + +A. Move handling of se->xftfont null case to the + correct place +B. Wrap only the debugging code part with ifdef DEBUG +--- + hacks/fontglide.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/hacks/fontglide.c b/hacks/fontglide.c +index b9aa2e0..d083d0c 100644 +--- a/hacks/fontglide.c ++++ b/hacks/fontglide.c +@@ -344,6 +344,16 @@ pick_font_1 (state *s, sentence *se) + se->xftfont = XftFontOpenXlfd (s->dpy, screen_number (s->xgwa.screen), + pattern); + ++ if (! se->xftfont) ++ { ++# ifdef DEBUG ++ if (s->debug_p) ++ fprintf (stderr, "%s: unable to load font %s\n", ++ progname, pattern); ++#endif ++ return False; ++ } ++ + /* Sometimes we get fonts with screwed up metrics. For example: + -b&h-lucida-medium-r-normal-sans-40-289-100-100-p-0-iso8859-1 + +@@ -429,14 +439,6 @@ pick_font_1 (state *s, sentence *se) + + + # ifdef DEBUG +- if (! se->xftfont) +- { +- if (s->debug_p) +- fprintf (stderr, "%s: unable to load font %s\n", +- progname, pattern); +- return False; +- } +- + if (s->debug_p) + fprintf(stderr, "%s: %s\n", progname, pattern); + # endif /* DEBUG */ +-- +2.1.0 + diff --git a/xscreensaver.spec b/xscreensaver.spec index a3c0a3f..22f1121 100644 --- a/xscreensaver.spec +++ b/xscreensaver.spec @@ -10,7 +10,7 @@ %define split_getimage 1 %endif -%define fedora_rel 8 +%define fedora_rel 9 %global use_clang_as_cc 0 %global use_clang_analyze 0 @@ -94,6 +94,9 @@ Patch205: xscreensaver-5.32-0005-flush_dialog_changes_and_save-strdup-for Patch206: xscreensaver-5.32-0006-build_substrate-fix-possibly-wrong-memset-usage.patch # cppcheck: utils/utf8wc.c: fix Unicode Combining Diacriticals Block Patch207: xscreensaver-5.32-0007-utils-utf8wc.c-fix-Unicode-Combining-Diacriticals-Bl.patch +# pick_font_1: rescue when XftFontOpenXlfd fails correctly +# bug 1195437 +Patch208: xscreensaver-5.32-0008-pick_font_1-rescue-when-XftFontOpenXlfd-fails-correc.patch # # Patches end Requires: xscreensaver-base = %{epoch}:%{version}-%{release} @@ -357,6 +360,7 @@ gzip -dc %{SOURCE50} > po/ja.po %__cat %PATCH205 | %__git am %__cat %PATCH206 | %__git am %__cat %PATCH207 | %__git am +%__cat %PATCH208 | %__git am change_option(){ set +x @@ -1007,6 +1011,10 @@ exit 0 %endif %changelog +* Fri Feb 27 2015 Mamoru TASAKA - 1:5.32-9 +- pick_font_1: rescue when XftFontOpenXlfd fails correctly + (bug 1195437) + * Wed Feb 10 2015 Mamoru TASAKA - Remove PATCH202 (fixed by gcc 5.0.0-0.10)