mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 23:15:38 +00:00
Fixed a large memory leak in the scraper.
This commit is contained in:
parent
c3d5614cfc
commit
87cc3e88d2
|
@ -498,8 +498,10 @@ bool resizeImage(const std::string& path, int maxWidth, int maxHeight)
|
|||
|
||||
// If the image is smaller than maxWidth or maxHeight, then don't do any
|
||||
// scaling. It doesn't make sense to upscale the image and waste disk space.
|
||||
if (maxWidth > width || maxHeight > height)
|
||||
if (maxWidth > width || maxHeight > height) {
|
||||
FreeImage_Unload(image);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (maxWidth == 0)
|
||||
maxWidth = static_cast<int>((maxHeight / height) * width);
|
||||
|
|
Loading…
Reference in a new issue