From c8da09410c94c5da425f5dfcf471a67fd3f8375e Mon Sep 17 00:00:00 2001 From: kramm Date: Sat, 12 Jun 2004 16:02:47 +0000 Subject: [PATCH] fixed a font bug, added handling for NULL in glyphnames. --- lib/modules/swftext.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index affedb3..2b2bf91 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -625,7 +625,7 @@ int swf_FontSetDefine2(TAG *tag, SWFFONT * f) flags |= 4; //wide codecs if(fontSize(f)>65535) flags |= 8; //wide offsets - flags |= 8; //FIXME: the above check doesn't work + flags |= 8|4; //FIXME: the above check doesn't work if(f->encoding & FONT_ENCODING_ANSI) flags |= 16; // ansi @@ -805,7 +805,8 @@ void swf_FontFree(SWFFONT * f) if(f->glyphnames) { int t; for(t=0;tnumchars;t++) { - free(f->glyphnames[t]); + if(f->glyphnames[t]) + free(f->glyphnames[t]); } free(f->glyphnames); } @@ -1028,7 +1029,10 @@ void swf_WriteFont(SWFFONT*font, char* filename) swf_SetU16(t, WRITEFONTID); swf_SetU16(t, font->numchars); for(c=0;cnumchars;c++) { - swf_SetString(t, font->glyphnames[c]); + if(font->glyphnames[c]) + swf_SetString(t, font->glyphnames[c]); + else + swf_SetString(t, ""); } } -- 1.7.10.4