Fixes crash for apng coder when properties are nil
This commit is contained in:
parent
767a6643f8
commit
d1eea26cd6
|
@ -154,6 +154,9 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef
|
||||||
float frameDuration = 0.1f;
|
float frameDuration = 0.1f;
|
||||||
CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
|
CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
|
||||||
NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
|
NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
|
||||||
|
if (!frameProperties) {
|
||||||
|
return frameDuration;
|
||||||
|
}
|
||||||
NSDictionary *pngProperties = frameProperties[(NSString *)kCGImagePropertyPNGDictionary];
|
NSDictionary *pngProperties = frameProperties[(NSString *)kCGImagePropertyPNGDictionary];
|
||||||
|
|
||||||
NSNumber *delayTimeUnclampedProp = pngProperties[(__bridge NSString *)kCGImagePropertyAPNGUnclampedDelayTime];
|
NSNumber *delayTimeUnclampedProp = pngProperties[(__bridge NSString *)kCGImagePropertyAPNGUnclampedDelayTime];
|
||||||
|
|
Loading…
Reference in New Issue