fixed format warnings
[swftools.git] / lib / png.c
index d71c19b..1738151 100644 (file)
--- a/lib/png.c
+++ b/lib/png.c
@@ -122,7 +122,7 @@ static int png_read_header(FILE*fi, struct png_header*header)
                return 0;
            }
            if(a!=8 && (b==2 || b==6)) {
-               printf("Bpp %d in mode %d not supported!\n", a);
+               printf("Bpp %d in mode %d not supported!\n", b, a);
                return 0;
            }
            if(c!=0) {
@@ -486,6 +486,7 @@ EXPORT int getPNG(const char*sname, int*destwidth, int*destheight, unsigned char
     }
 
     if(!png_read_header(fi, &header)) {
+       fclose(fi);
        return 0;
     }