Also free() when loading fails
This commit is contained in:
parent
11d13c406a
commit
e56d259b8e
@ -329,6 +329,7 @@ png_path_to_bitmap(const char* path, uint8_t** data, unsigned int* width, unsign
|
||||
inflate_png_inner(&d, buf, pos);
|
||||
free(buf);
|
||||
if (!d.ok) {
|
||||
free(d.decompressed); free(d.row_pointers);
|
||||
log_error("Failed to decode PNG image at: %s", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user