Committed by
lizhuoli
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
Showing
1 changed file
with
2 additions
and
0 deletions
@@ -376,8 +376,10 @@ didReceiveResponse:(NSURLResponse *)response | @@ -376,8 +376,10 @@ didReceiveResponse:(NSURLResponse *)response | ||
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
379 | + if (imageSource) { | ||
379 | CFRelease(imageSource); | 380 | CFRelease(imageSource); |
380 | } | 381 | } |
382 | + } | ||
381 | 383 | ||
382 | for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { | 384 | for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { |
383 | progressBlock(self.imageData.length, self.expectedSize, self.request.URL); | 385 | progressBlock(self.imageData.length, self.expectedSize, self.request.URL); |
-
Please register or login to post a comment