Merge pull request #2691 from zhongwuzw/fix_apng_property_crash
Fixes crash for apng coder when properties are nil
This commit is contained in:
commit
3540961abc
|
@ -153,6 +153,9 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef
|
|||
- (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
|
||||
float frameDuration = 0.1f;
|
||||
CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
|
||||
if (!cfFrameProperties) {
|
||||
return frameDuration;
|
||||
}
|
||||
NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
|
||||
NSDictionary *pngProperties = frameProperties[(NSString *)kCGImagePropertyPNGDictionary];
|
||||
|
||||
|
|
Loading…
Reference in New Issue