From 88762a370b7b8c601725683a229173e400a4eaef Mon Sep 17 00:00:00 2001
From: kramm <kramm>
Date: Sun, 6 Jun 2004 14:24:49 +0000
Subject: [PATCH] prevent against missing glyphs in swf_DrawText.

---
 lib/modules/swftext.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c
index 683f494..29e3fb3 100644
--- a/lib/modules/swftext.c
+++ b/lib/modules/swftext.c
@@ -1265,6 +1265,10 @@ void swf_DrawText(drawer_t*draw, SWFFONT*font, int size, char*text)
 	U32 c = readUTF8char(&s);
 	int g = font->ascii2glyph[c];
 	shape = font->glyph[g].shape;
+	if(((int)g)<0) {
+	    fprintf(stderr, "No char %d in font %s\n", c, font->name?(char*)font->name:"?");
+	    continue;
+	}
 	shape2 = swf_ShapeToShape2(shape);
 	l = shape2->lines;
 	while(l) {
-- 
1.7.10.4