* src/sfnt/ttload.c (tt_face_free_names): Check that `table->names' is not NULL. Reported by Gordon Childs <gchilds@quickcut.com.au>.
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
diff --git a/ChangeLog b/ChangeLog
index dcbdba5..866c4ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-02 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/ttload.c (tt_face_free_names): Check that `table->names'
+ is not NULL. Reported by Gordon Childs <gchilds@quickcut.com.au>.
+
2004-04-29 Werner Lemberg <wl@gnu.org>
* docs/formats.txt: Add more information on PFR format.
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index d1b0b20..95d49b9 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -1198,14 +1198,17 @@
FT_UInt count = table->numNameRecords;
- for ( ; count > 0; count--, entry++ )
+ if ( table->names )
{
- FT_FREE( entry->string );
- entry->stringLength = 0;
- }
+ for ( ; count > 0; count--, entry++ )
+ {
+ FT_FREE( entry->string );
+ entry->stringLength = 0;
+ }
- /* free strings table */
- FT_FREE( table->names );
+ /* free strings table */
+ FT_FREE( table->names );
+ }
table->numNameRecords = 0;
table->format = 0;