Merge pull request #3373 from dreampiggy/fix_clang_analyze_issue

Fix the clang analyze issue
This commit is contained in:
DreamPiggy 2022-07-16 19:46:17 +08:00 committed by GitHub
commit 7269107908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -552,11 +552,6 @@ static id<SDImageLoader> _defaultImageLoader;
cacheType:(SDImageCacheType)cacheType
finished:(BOOL)finished
completed:(nullable SDInternalCompletionBlock)completedBlock {
// the target image store cache type
SDImageCacheType storeCacheType = SDImageCacheTypeAll;
if (context[SDWebImageContextStoreCacheType]) {
storeCacheType = [context[SDWebImageContextStoreCacheType] integerValue];
}
id<SDImageTransformer> transformer = context[SDWebImageContextImageTransformer];
if (![transformer conformsToProtocol:@protocol(SDImageTransformer)]) {
transformer = nil;
@ -661,7 +656,7 @@ static id<SDImageLoader> _defaultImageLoader;
BOOL shouldThumbnailImage = context[SDWebImageContextImageThumbnailPixelSize] != nil || image.sd_decodeOptions[SDImageCoderDecodeThumbnailPixelSize] != nil;
// Store the transformed/thumbnail image into the cache
if (transformed || shouldThumbnailImage) {
if (image && (transformed || shouldThumbnailImage)) {
NSData *cacheData;
// pass nil if the image was transformed/thumbnailed, so we can recalculate the data from the image
if (cacheSerializer && (storeCacheType == SDImageCacheTypeDisk || storeCacheType == SDImageCacheTypeAll)) {

View File

@ -576,6 +576,8 @@ static inline CGImageRef _Nullable SDCreateCGImageFromCIImage(CIImage * _Nonnull
return SDGetColorFromRGBA(pixel, bitmapInfo);
} else {
NSLog(@"Unsupported components: %zu", components);
CFRelease(data);
CGImageRelease(imageRef);
return nil;
}
}