From cf7981a3b419ea431d6501a157cbcbac8dbf408e Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sun, 27 Jan 2019 21:02:18 +0800 Subject: [PATCH] Fix one leak of vImageConvertor --- SDWebImageWebPCoder/Classes/SDImageWebPCoder.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m b/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m index e59132e..a4238a6 100644 --- a/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m +++ b/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m @@ -595,12 +595,14 @@ error = vImageBuffer_Init(&dest, height, width, destFormat.bitsPerPixel, kvImageNoFlags); if (error != kvImageNoError) { + vImageConverter_Release(convertor); CFRelease(dataRef); return nil; } // Convert input color mode to RGB888/RGBA8888 error = vImageConvert_AnyToAny(convertor, &src, &dest, NULL, kvImageNoFlags); + vImageConverter_Release(convertor); if (error != kvImageNoError) { CFRelease(dataRef); return nil;