imageio: fix issues/crash on png with transparency
If a png has a transparency chunk (tRNS), after converting the transparency to alpha we should also strip alpha (color_type is not updated with PNG_COLOR_MASK_ALPHA flag set) or the row parsing will return also the alpha channel causing a memory overflow.
This commit is contained in:
@@ -285,6 +285,7 @@ int ImageIO::loadPNG (const Glib::ustring &fname)
|
||||
|
||||
if (png_get_valid(png, info, PNG_INFO_tRNS)) {
|
||||
png_set_tRNS_to_alpha(png);
|
||||
png_set_strip_alpha(png);
|
||||
}
|
||||
|
||||
if (color_type & PNG_COLOR_MASK_ALPHA) {
|
||||
|
Reference in New Issue
Block a user