X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfbits.c;h=19dde1c579bd6d544232e92447e8fad05416b682;hb=ec646624d627bef5c3d538be9e3b6dcad65bbf2e;hp=b85eb584de5ca3bb4e46aeb4adf2a6cc8c57dc1b;hpb=8526dcf3a698c688e2cc4430ae106b5ecf70677f;p=swftools.git diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index b85eb58..19dde1c 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -293,6 +293,7 @@ RGBA* swf_JPEG2TagToImage(TAG*tag, int*width, int*height) struct jpeg_error_mgr jerr; struct jpeg_source_mgr mgr; RGBA * dest; + int y; *width = 0; *height = 0; @@ -323,7 +324,6 @@ RGBA* swf_JPEG2TagToImage(TAG*tag, int*width, int*height) dest = rfx_alloc(sizeof(RGBA)*cinfo.image_width*cinfo.image_height); jpeg_start_decompress(&cinfo); - int y; for (y=0;yfirstTag; + TAG* tables_tag = 0; + while(tag) { + if(tag->id == ST_JPEGTABLES) { + tables_tag = tag; + } + tag = tag->next; + } + + if(!tables_tag) + return; + + tag = swf->firstTag; + while(tag) { + if(tag->id == ST_DEFINEBITSJPEG) { + void*data = rfx_alloc(tag->len); + swf_GetBlock(tag, data, tag->len); + swf_ResetTag(tag, ST_DEFINEBITSJPEG2); + swf_SetBlock(tag, tables_tag->data, tables_tag->len); + swf_SetBlock(tag, data, tag->len); + free(data); + } + tag = tag->next; + } + if(swf->firstTag == tables_tag) + swf->firstTag = tables_tag->next; + swf_DeleteTag(tables_tag); +} + +