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