aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-06-06 11:18:17 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-06-06 11:18:17 +0000
commitee91b5df227327a79292d130410316218318f9d5 (patch)
treee1a6f6d079918c35027923a3dd196cbedb3b3fd7 /lib
parent25e60bd7d5288cfbc6c5645bf7d4242cb82a8974 (diff)
downloadenigma2-ee91b5df227327a79292d130410316218318f9d5.tar.gz
enigma2-ee91b5df227327a79292d130410316218318f9d5.zip
only allow gray pngs or pngs with palette
Diffstat (limited to 'lib')
-rw-r--r--lib/gdi/epng.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gdi/epng.cpp b/lib/gdi/epng.cpp
index 6b08c2d8..0f8ea568 100644
--- a/lib/gdi/epng.cpp
+++ b/lib/gdi/epng.cpp
@@ -70,9 +70,7 @@ int loadPNG(ePtr<gPixmap> &result, const char *filename)
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
-// eDebug("%s: %dx%dx%d png, %d", filename, (int)width, (int)height, (int)bit_depth, color_type);
-
- if (color_type != 6)
+ if (color_type == PNG_COLOR_TYPE_GRAY || color_type & PNG_COLOR_MASK_PALETTE)
{
result=new gPixmap(eSize(width, height), bit_depth);
gSurface *surface = result->surface;
@@ -117,8 +115,10 @@ int loadPNG(ePtr<gPixmap> &result, const char *filename)
}
surface->clut.start=0;
png_read_end(png_ptr, end_info);
- } else
+ } else {
result=0;
+ eDebug("%s: %dx%dx%d png, %d", filename, (int)width, (int)height, (int)bit_depth, color_type);
+ }
png_destroy_read_struct(&png_ptr, &info_ptr,&end_info);
fclose(fp);