Fix Savannah bug #30261. * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain neither outline nor bitmap glyphs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/ChangeLog b/ChangeLog
index 91fa85c..72abfac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-06-25 Werner Lemberg <wl@gnu.org>
+ Fix Savannah bug #30261.
+
+ * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain
+ neither outline nor bitmap glyphs.
+
+2010-06-25 Werner Lemberg <wl@gnu.org>
+
Fix Savannah bug #30254.
* src/cff/cffload.c (cff_index_get_pointers): Do sanity check for
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 56d617d..307e6d3 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (body). */
/* */
-/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
+/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -146,8 +146,17 @@
if ( phy_font->chars[nn].gps_offset != 0 )
break;
- if ( nn == phy_font->num_chars )
- pfrface->face_flags = 0; /* not scalable */
+ if ( phy_font->num_strikes > 0 )
+ {
+ if ( nn == phy_font->num_chars )
+ pfrface->face_flags = 0; /* not scalable */
+ }
+ else
+ {
+ FT_ERROR(( "pfr_face_init: font doesn't contain glyphs\n" ));
+ error = PFR_Err_Invalid_File_Format;
+ goto Exit;
+ }
}
if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )