From: kramm <kramm>
Date: Sun, 16 Apr 2006 13:36:37 +0000 (+0000)
Subject: added some consistency checking for id table
X-Git-Tag: release-0-8-0~223
X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=091ccad45e9da6e00bfbb41fdd160b86084fc2fe;p=swftools.git

added some consistency checking for id table
---

diff --git a/lib/modules/swfrender.c b/lib/modules/swfrender.c
index 994ac29..64dc696 100644
--- a/lib/modules/swfrender.c
+++ b/lib/modules/swfrender.c
@@ -1012,7 +1012,10 @@ static void textcallback(void*self, int*chars, int*xpos, int nr, int fontid, int
     textcallbackblock_t * info = (textcallbackblock_t*)self;
     font_t*font = 0;
     int t;
-    if(!info->idtable[fontid].obj.font) {
+    if(info->idtable[fontid].type != font_type) {
+	fprintf(stderr, "ID %d is not a font\n", fontid);
+	return;
+    } else if(!info->idtable[fontid].obj.font) {
 	fprintf(stderr, "Font %d unknown\n", fontid);
 	return;
     } else {