From 87cc3e88d28bea4780b3eb9906e1d0c36fef4742 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 15 Mar 2021 20:11:01 +0100 Subject: [PATCH] Fixed a large memory leak in the scraper. --- es-app/src/scrapers/Scraper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp index 09789c512..f6345d7d8 100644 --- a/es-app/src/scrapers/Scraper.cpp +++ b/es-app/src/scrapers/Scraper.cpp @@ -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((maxHeight / height) * width);