From 6fdc94bc2b31b689c508e83d80a1ece74be1e474 Mon Sep 17 00:00:00 2001 From: kramm Date: Wed, 9 Jan 2002 11:20:13 +0000 Subject: [PATCH] big endian fixes. --- src/swfextract.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/swfextract.c b/src/swfextract.c index 1e1f204..62b6168 100644 --- a/src/swfextract.c +++ b/src/swfextract.c @@ -152,9 +152,9 @@ char * tagused; void idcallback(void*data) { - if(!(used[*(U16*)data]&1)) { + if(!(used[SWAP16(*(U16*)data)]&1)) { changed = 1; - used[*(U16*)data] |= 1; + used[SWAP16(*(U16*)data)] |= 1; } } @@ -395,7 +395,7 @@ void handlejpeg(TAG*tag) { char name[80]; FILE*fi; - sprintf(name, "pic%d.jpeg", *(U16*)tag->data); + sprintf(name, "pic%d.jpeg", SWAP16(*(U16*)tag->data)); /* swf jpeg images have two streams, which both start with ff d8 and end with ff d9. The following code handles sorting the middle bytes out, so that one stream remains */ @@ -417,7 +417,7 @@ void handlejpeg(TAG*tag) fclose(fi); } if(tag->id == ST_DEFINEBITSJPEG3 && tag->len>6) { - U32 end = *(U32*)&tag->data[2]+6; + U32 end = SWAP32(*(U32*)&tag->data[2])+6; int pos = findjpegboundary(&tag->data[6], tag->len-6); if(pos<0) return; -- 1.7.10.4