[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ftfont.c seg fault problem

From: Lynbech Christian
Subject: [PATCH] ftfont.c seg fault problem
Date: Fri, 16 Jan 2009 15:28:39 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

I have had a number of problems with recent updates of emacs 23
segmentation faulting on me when trying to use the font backend and
antialiased fonts.

I am unsure exactly what is causing the problem. It works fine when I
compile it on a rather freshly updated debian system but the problem
hits when trying to build and run on my primary workstation which is a
SuSE SLED 10 SP1 system with some additional software installed. In
particular this system doesn't really have gtk+ 2.0 and fontconfig
claims to be version 2.3.94 and I am enabling the font backend and is
trying to use fancy anti-aliased fonts.

The problem hits in src/ftfont.c (ftfont_lookup_cache). The attached
patch seems to alleviate the problem, at least to the point where emacs
stops segmentation faulting. Even if the problem ultimately is a
unfortunate combination of old libraries, I believe the patch is
innocent enough to warrant inclusion.

More information can be provided if you like.

                              -- Christian

Index: ftfont.c
--- ftfont.c    (revision 1405)
+++ ftfont.c    (working copy)
@@ -311,8 +311,9 @@
          objset = FcObjectSetBuild (FC_CHARSET, NULL);
          fontset = FcFontList (NULL, pat, objset);
          xassert (fontset && fontset->nfont > 0);
-         if (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, &charset)
-             == FcResultMatch)
+         if (fontset->fonts &&
+             (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, &charset)
+              == FcResultMatch))
            cache_data->fc_charset = FcCharSetCopy (charset);
            cache_data->fc_charset = FcCharSetCreate ();

Christian Lynbech       | christian #\@ defun #\. dk
Hit the philistines three times over the head with the Elisp reference manual.
                                        - address@hidden (Michael A. Petonic)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]