Fixed crash if there is no font installed (by no-fonts-fix patch)

Resolves: rhbz#1229991
This commit is contained in:
Jaroslav Škarvada 2015-07-02 17:51:46 +02:00
parent 42c9ae8a27
commit e9c9304d9b
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -pruN tk8.6.4.orig/unix/tkUnixRFont.c tk8.6.4/unix/tkUnixRFont.c
--- tk8.6.4.orig/unix/tkUnixRFont.c 2015-02-27 02:13:18.000000000 +0900
+++ tk8.6.4/unix/tkUnixRFont.c 2015-06-10 14:35:20.639365954 +0900
@@ -259,7 +259,7 @@ InitFont(
*/
set = FcFontSort(0, pattern, FcTrue, NULL, &result);
- if (!set) {
+ if (!set || set->nfont == 0) {
ckfree(fontPtr);
return NULL;
}

View File

@ -4,7 +4,7 @@
Summary: The graphical toolkit for the Tcl scripting language
Name: tk
Version: %{vers}
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 1
License: TCL
Group: Development/Languages
@ -25,6 +25,7 @@ Patch1: tk-8.6.1-make.patch
Patch2: tk-8.6.3-conf.patch
# fix implicit linkage of freetype that breaks xft detection (#677692)
Patch3: tk-8.6.1-fix-xft.patch
Patch4: tk-8.6.4-no-fonts-fix.patch
%description
When paired with the Tcl scripting language, Tk provides a fast and powerful
@ -49,6 +50,7 @@ The package contains the development files and man pages for tk.
%patch1 -p1 -b .make
%patch2 -p1 -b .conf
%patch3 -p1 -b .fix-xft
%patch4 -p1 -b .no-fonts-fix
%build
cd unix
@ -113,6 +115,10 @@ sed -i -e "s|$PWD/unix|%{_libdir}|; s|$PWD|%{_includedir}/%{name}-private|" %{bu
%{_datadir}/%{name}%{majorver}/tkAppInit.c
%changelog
* Thu Jul 2 2015 Jaroslav Škarvada <jskarvad@redhat.com> - 1:8.6.4-2
- Fixed crash if there is no font installed (by no-fonts-fix patch)
Resolves: rhbz#1229991
* Fri Mar 13 2015 Jaroslav Škarvada <jskarvad@redhat.com> - 1:8.6.4-1
- New version