Skip to content

Commit

Permalink
Fail PNG load on unrecognized pixel formats
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtribick committed Oct 26, 2024
1 parent a4fc0b7 commit 7e9b993
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/celengine/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,10 @@ Image* LoadPNGImage(const string& filename)
break;
default:
// badness
break;
fclose(fp);
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
clog << _("Invalid format in PNG file ") << filename << '\n';
return NULL;
}

img = new Image(glformat, width, height);
Expand Down

0 comments on commit 7e9b993

Please sign in to comment.