Fixed a memory leak in Image::readPngMetadata()
The memory allocated by png_create_read_struct() was not freed before exiting the function, wasting lots of memory over time.
This commit is contained in:
parent
86106b06d6
commit
42fc1d6714
@ -184,6 +184,8 @@ tuple<Vec2U, PixelFormat> Image::readPngMetadata(IODevicePtr device) {
|
|||||||
channels += 1;
|
channels += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
|
||||||
|
|
||||||
Vec2U imageSize{img_width, img_height};
|
Vec2U imageSize{img_width, img_height};
|
||||||
PixelFormat pixelFormat = channels == 3 ? PixelFormat::RGB24 : PixelFormat::RGBA32;
|
PixelFormat pixelFormat = channels == 3 ? PixelFormat::RGB24 : PixelFormat::RGBA32;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user