X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.c;h=d7f8f88903b1c2708d4131c8ac6701c57d87c187;hb=932140891afa7110a75cfc938e7f68d14306d93e;hp=beef81e75d618734b4c8d931b262ee97fdf95599;hpb=a1cb9cb40f74933888e5593dbd62f72707228ed2;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index beef81e..d7f8f88 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -54,8 +54,8 @@ void* rfx_alloc(int size) { void*ptr; if(size == 0) { - *(int*)0 = 0xdead; - fprintf(stderr, "Warning: Zero alloc\n"); + //*(int*)0 = 0xdead; + //fprintf(stderr, "Warning: Zero alloc\n"); return 0; } @@ -71,8 +71,8 @@ void* rfx_realloc(void*data, int size) { void*ptr; if(size == 0) { - *(int*)0 = 0xdead; - fprintf(stderr, "Warning: Zero realloc\n"); + //*(int*)0 = 0xdead; + //fprintf(stderr, "Warning: Zero realloc\n"); rfx_free(data); return 0; } @@ -93,8 +93,8 @@ void* rfx_calloc(int size) { void*ptr; if(size == 0) { - *(int*)0 = 0xdead; - fprintf(stderr, "Warning: Zero alloc\n"); + //*(int*)0 = 0xdead; + //fprintf(stderr, "Warning: Zero alloc\n"); return 0; } #ifdef HAVE_CALLOC @@ -916,7 +916,12 @@ TAG * swf_ReadTag(struct reader_t*reader, TAG * prev) if (t->len) { t->data = (U8*)rfx_alloc(t->len); t->memsize = t->len; - if (reader->read(reader, t->data, t->len) != t->len) return NULL; + if (reader->read(reader, t->data, t->len) != t->len) { + fprintf(stderr, "rfxswf: Warning: Short read (tagid %d). File truncated?\n", t->id); + free(t->data);t->data=0; + free(t); + return NULL; + } } if (prev)