mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-31 13:05:52 +01:00
fix for 0 sized images
This commit is contained in:
@@ -112,6 +112,15 @@ RLoadPNG(RContext *context, char *file, int index)
|
||||
png_get_IHDR(png, pinfo, &width, &height, &depth, &color_type,
|
||||
&junk, &junk, &junk);
|
||||
|
||||
|
||||
/* sanity check */
|
||||
if (width < 1 || height < 1) {
|
||||
fclose(f);
|
||||
png_destroy_read_struct(&png, &pinfo, &einfo);
|
||||
RErrorCode = RERR_BADIMAGEFILE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* check for an alpha channel */
|
||||
if (png_get_valid(png, pinfo, PNG_INFO_tRNS))
|
||||
|
||||
Reference in New Issue
Block a user