OSDN Git Service

rgb15:1 and not PNG24 is error.
authorYoshihiro Yamazaki <yoya@awm.jp>
Sat, 4 Feb 2012 13:51:17 +0000 (22:51 +0900)
committerYoshihiro Yamazaki <yoya@awm.jp>
Sat, 4 Feb 2012 13:51:17 +0000 (22:51 +0900)
src/swf_png.c

index bc9cb4f..c475b48 100644 (file)
@@ -145,6 +145,11 @@ pngconv_png2lossless(unsigned char *png_data, unsigned long png_data_len,
                  NULL, NULL, NULL);
     *width = (unsigned short) png_width;
     *height = (unsigned short) png_height;
+
+    if ((rgb15 > 0) && (color_type !=  PNG_COLOR_TYPE_RGB)) { // warning
+        fprintf(stderr, "rgb15 is %d but color_type is not PNG24\n", rgb15);
+    }
+
     switch(color_type) {
     case PNG_COLOR_TYPE_PALETTE:
         *format = 3;