X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fpng2swf.c;h=8d1c4767eec29d9ff8559b118f8bb5c54d87d73b;hp=91f2188ec4996b7317ae789a8804cf8d17bd4a52;hb=5a4a20931aade60f0e99df0819fbd1c007a705da;hpb=2391d7ae5d8a145a250a8b80ab8c93ba74eba030 diff --git a/src/png2swf.c b/src/png2swf.c index 91f2188..8d1c476 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -119,7 +119,7 @@ int png_read_chunk(char (*head)[4], int*destlen, U8**destdata, FILE*fi) return 0; if(!fread(head, 4, 1, fi)) return 0; - len = REVERSESWAP32(len); + len = BE_32_TO_NATIVE(len); if(destlen) *destlen = len; if(destdata) { if(len) @@ -143,7 +143,7 @@ unsigned int png_get_dword(FILE*fi) { unsigned int a; fread(&a,4,1,fi); - return REVERSESWAP32(a); + return BE_32_TO_NATIVE(a); } struct png_header @@ -173,8 +173,8 @@ int png_read_header(FILE*fi, struct png_header*header) if(!strncasecmp(id, "IHDR", 4)) { char a,b,c,f,i; if(len < 8) exit(1); - header->width = REVERSESWAP32(*(U32*)&data[0]); - header->height = REVERSESWAP32(*(U32*)&data[4]); + header->width = BE_32_TO_NATIVE(*(U32*)&data[0]); + header->height = BE_32_TO_NATIVE(*(U32*)&data[4]); a = data[8]; // should be 8 b = data[9]; // should be 3(indexed), 2(rgb), 0(grayscale) or 6(truecolor+alpha) @@ -749,7 +749,7 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) MATRIX m; int fs; - int width=0, height=0; + unsigned width=0, height=0; #ifndef HAVE_JPEGLIB if(global.mkjpeg) {