mirror of
https://github.com/zhigang1992/PINRemoteImage.git
synced 2026-04-24 04:15:32 +08:00
Fix crash that can occur if image creation failed. (#204)
CFAutorelease crashes if you pass in NULL.
This commit is contained in:
@@ -197,7 +197,9 @@ void releaseData(void *data, const void *imageData, size_t size)
|
||||
NULL,
|
||||
NO,
|
||||
kCGRenderingIntentDefault);
|
||||
CFAutorelease(imageRef);
|
||||
if (imageRef) {
|
||||
CFAutorelease(imageRef);
|
||||
}
|
||||
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
CGDataProviderRelease(dataProvider);
|
||||
|
||||
Reference in New Issue
Block a user