struct jpeg_error_mgr jerr;
struct jpeg_source_mgr mgr;
RGBA * dest;
+ int y;
*width = 0;
*height = 0;
dest = rfx_alloc(sizeof(RGBA)*cinfo.image_width*cinfo.image_height);
jpeg_start_decompress(&cinfo);
- int y;
for (y=0;y<cinfo.output_height;y++) {
RGBA* line = &dest[y*cinfo.image_width];
U8* to = (U8*)line;
#undef OUTBUFFER_SIZE
+
+void swf_RemoveJPEGTables(SWF*swf)
+{
+ TAG* tag = swf->firstTag;
+ 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);
+}
+
+