git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 0.94.1 of the bladeenc mp3 encoder
[swftools.git]
/
src
/
swfextract.c
diff --git
a/src/swfextract.c
b/src/swfextract.c
index
50a4f75
..
99844eb
100644
(file)
--- a/
src/swfextract.c
+++ b/
src/swfextract.c
@@
-152,9
+152,9
@@
char * tagused;
void idcallback(void*data)
{
void idcallback(void*data)
{
- if(!(used[*(U16*)data]&1)) {
+ if(!(used[GET16(data)]&1)) {
changed = 1;
changed = 1;
- used[*(U16*)data] |= 1;
+ used[GET16(data)] |= 1;
}
}
}
}
@@
-165,13
+165,16
@@
void enumerateIDs(TAG*tag, void(*callback)(void*))
if(tag->len>=64) {
len += 6;
data = (U8*)malloc(len);
if(tag->len>=64) {
len += 6;
data = (U8*)malloc(len);
- *(U16*)data = (tag->id<<6)+63;
- *(U32*)&data[2] = tag->len;
+ PUT16(data, (tag->id<<6)+63);
+ *(U8*)&data[2] = tag->len;
+ *(U8*)&data[3] = tag->len>>8;
+ *(U8*)&data[4] = tag->len>>16;
+ *(U8*)&data[5] = tag->len>>24;
memcpy(&data[6], tag->data, tag->len);
} else {
len += 2;
data = (U8*)malloc(len);
memcpy(&data[6], tag->data, tag->len);
} else {
len += 2;
data = (U8*)malloc(len);
- *(U16*)data = (tag->id<<6)+tag->len;
+ PUT16(data, (tag->id<<6)+tag->len);
memcpy(&data[2], tag->data, tag->len);
}
map_ids_mem(data, len, callback);
memcpy(&data[2], tag->data, tag->len);
}
map_ids_mem(data, len, callback);
@@
-392,7
+395,7
@@
void handlejpeg(TAG*tag)
{
char name[80];
FILE*fi;
{
char name[80];
FILE*fi;
- sprintf(name, "pic%d.jpeg", *(U16*)tag->data);
+ sprintf(name, "pic%d.jpeg", GET16(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
<ff d9 ff d8> bytes out, so that one stream remains */
/* swf jpeg images have two streams, which both start with ff d8 and
end with ff d9. The following code handles sorting the middle
<ff d9 ff d8> bytes out, so that one stream remains */
@@
-414,7
+417,7
@@
void handlejpeg(TAG*tag)
fclose(fi);
}
if(tag->id == ST_DEFINEBITSJPEG3 && tag->len>6) {
fclose(fi);
}
if(tag->id == ST_DEFINEBITSJPEG3 && tag->len>6) {
- U32 end = *(U32*)&tag->data[2]+6;
+ U32 end = GET32(&tag->data[2])+6;
int pos = findjpegboundary(&tag->data[6], tag->len-6);
if(pos<0)
return;
int pos = findjpegboundary(&tag->data[6], tag->len-6);
if(pos<0)
return;