From 8fc731e012d40d7b9fbe315851a6928b566e474f Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 11 Jan 2024 14:43:34 +0800 Subject: [PATCH] Fix the warning during clang-analyze --- SDWebImage/Core/SDImageIOAnimatedCoder.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SDWebImage/Core/SDImageIOAnimatedCoder.m b/SDWebImage/Core/SDImageIOAnimatedCoder.m index d28f0060..dca44f18 100644 --- a/SDWebImage/Core/SDImageIOAnimatedCoder.m +++ b/SDWebImage/Core/SDImageIOAnimatedCoder.m @@ -229,7 +229,8 @@ static BOOL SDImageIOPNGPluginBuggyNeedWorkaround(void) { NSCParameterAssert(source); CGImageRef cgImage = CGImageSourceCreateImageAtIndex(source, 0, nil); NSCParameterAssert(cgImage); - uint8_t r, g, b, a = 0; + uint8_t r, g, b, a; + r = g = b = a = 0; BOOL success = SDLoadOnePixelBitmapBuffer(cgImage, &r, &g, &b, &a); if (!success) { isBuggy = NO; // Impossible... @@ -238,7 +239,7 @@ static BOOL SDImageIOPNGPluginBuggyNeedWorkaround(void) { // Correct value isBuggy = NO; } else { - SD_LOG("Detected the current OS's ImageIO PNG Decoder is buggy on indexed color PNG. Perform workaround solution..."); + SD_LOG("%@", @"Detected the current OS's ImageIO PNG Decoder is buggy on indexed color PNG. Perform workaround solution..."); isBuggy = YES; } }