Fix CFRelease on NULL if CGImageSourceRef create failed

Fix CFRelease on NULL if CGImageSourceRef create failed, this may happen on progressive download with wrong image data
This commit is contained in:
DreamPiggy 2017-08-02 17:14:37 +08:00 committed by lizhuoli
parent 49772b3bc9
commit c7a444f4a7
1 changed files with 3 additions and 1 deletions

View File

@ -376,7 +376,9 @@ didReceiveResponse:(NSURLResponse *)response
}
}
CFRelease(imageSource);
if (imageSource) {
CFRelease(imageSource);
}
}
for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) {