From: boehme Date: Mon, 3 Dec 2001 22:23:49 +0000 (+0000) Subject: swfdump: fix segfault and endless loop; improved action code output X-Git-Tag: release-0-2-1~59 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=69d7d2022ba5d1b8e2433a0a3b81ebdeaa950e68 swfdump: fix segfault and endless loop; improved action code output --- diff --git a/lib/modules/swfaction.c b/lib/modules/swfaction.c index 652fd6d..014730b 100644 --- a/lib/modules/swfaction.c +++ b/lib/modules/swfaction.c @@ -13,6 +13,8 @@ #include "../rfxswf.h" +#define MAX_LOOKUP 1024 // make cross references in dumps + struct Action { int version; @@ -229,7 +231,7 @@ int OpAdvance(char c, char*data) return 1+4; //int } else if (type == 8) { return 1+1; //lookup - } + } else return 1; break; } } @@ -242,8 +244,18 @@ void swf_DumpActions(ActionTAG*atag, char*prefix) int t; U8*data; char* cp; - if(!prefix) - prefix=""; + int entry = 0; + +#ifdef MAX_LOOKUP + + char * lookup[MAX_LOOKUP]; + memset(lookup,0x00,sizeof(lookup)); + +#endif + + if (!prefix) + prefix=""; + while(atag) { U8 poollen = 0; @@ -278,9 +290,14 @@ void swf_DumpActions(ActionTAG*atag, char*prefix) } break; case 'c': { printf(" String:\"%s\"", data); +#ifdef MAX_LOOKUP + if (entrynext; } + +#ifdef MAX_LOOKUP + for (t=0;t