Image_WritePNG: image should be freed using lodepng_free

This commit is contained in:
Ozkan Sezer 2022-07-01 20:00:10 +03:00
parent 09216eb65f
commit 673a4a7315
1 changed files with 3 additions and 2 deletions

View File

@ -628,10 +628,11 @@ qboolean Image_WritePNG (const char *name, byte *data, int width, int height, in
#endif
lodepng_state_cleanup (&state);
free (png);
lodepng_free (png); /* png was allocated by lodepng */
free (filters);
if (!upsidedown)
if (!upsidedown) {
free (flipped);
}
return (error == 0);
}