The attached patch to libfreetype6 seems to fix the fontconfig segfault
for me. I don't understand fonts, of fontconfig, however, so I might be
completely wrong. I just traced the problem in gdb and read the code
until I found something that seemed like the likely culprit.

Jason, this is just for your information, if you don't want to (or don't
know how to) apply the patch to the libfreetype6 sources.

Anthony, this seems to be a bug in your package? I understand you've
been busy with other things (which is fine, I'm not complaining); do you
have time to check this out?

Keith, according to my analysis, the problem is in libfreetype6, but
Anthony Fok, who maintains it, seems to not have been active for a
while. Assuming you understand font stuff better than I do, could you
have a quick look and check that my fix is correct?

If I can be convinced that this patch is right, and Anthony does not
have the time to do an upload of libfreetype6, I can do a non-maintainer
upload.

Hopefully this has been useful. Happy hacking.

diff -ruN freetype-2.1.7/debian/changelog fixed/debian/changelog
--- freetype-2.1.7/debian/changelog	2005-04-11 17:38:28.480523264 +0300
+++ fixed/debian/changelog	2005-04-11 17:40:41.852247680 +0300
@@ -1,3 +1,11 @@
+freetype (2.1.7-2.4) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/300-bdf-zero-width-glyph-fix.diff: Patch to make BDF
+    files with zero width or height glyphs work.
+  
+ -- Lars Wirzenius <[EMAIL PROTECTED]>   Mon, 11 Apr 2005 17:40:00 +0300
+
 freetype (2.1.7-2.3) unstable; urgency=low
 
   * NMU
diff -ruN freetype-2.1.7/debian/patches/300-bdf-zero-width-glyph-fix.diff fixed/debian/patches/300-bdf-zero-width-glyph-fix.diff
--- freetype-2.1.7/debian/patches/300-bdf-zero-width-glyph-fix.diff	1970-01-01 02:00:00.000000000 +0200
+++ fixed/debian/patches/300-bdf-zero-width-glyph-fix.diff	2005-04-11 17:11:46.862006000 +0300
@@ -0,0 +1,11 @@
+--- freetype-2.1.7/src/bdf/bdflib.c.borken	2005-04-11 17:10:17.114649960 +0300
++++ freetype-2.1.7/src/bdf/bdflib.c	2005-04-11 17:10:53.098179632 +0300
+@@ -1832,7 +1832,7 @@
+       glyph->bpr   = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;
+       glyph->bytes = (unsigned short)( glyph->bpr * glyph->bbx.height );
+ 
+-      if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) )
++      if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes + 1) )
+         goto Exit;
+ 
+       p->row    = 0;
diff -ruN freetype-2.1.7/debian/rules fixed/debian/rules
--- freetype-2.1.7/debian/rules	2005-04-11 17:38:28.478523568 +0300
+++ fixed/debian/rules	2005-04-11 17:17:31.137668000 +0300
@@ -160,6 +160,9 @@
 	# backport of normalization fix (#259875)
 	patch -p0 -i $(patchdir)/090-freetype-2.1.7-normalize-fix.diff
 
+	# Fix for bdf fonts with zero sized glyphs
+	patch -p0 -i $(patchdir)/300-bdf-zero-width-glyph-fix.diff
+
 	cd $(freetype_u) && ./configure --prefix=/usr CFLAGS=\"$(CFLAGS)\"
 #	cd $(freetype_u) && ./configure --prefix=/usr
 	$(MAKE) -C $(freetype_u)

Reply via email to