Protect against malformed image
Don’t add nil to the array, just skip the frame.
This commit is contained in:
parent
64f621081c
commit
3b039d5910
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
for (size_t i = 0; i < count; i++) {
|
for (size_t i = 0; i < count; i++) {
|
||||||
CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
|
CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
|
||||||
|
if (!image)
|
||||||
|
continue;
|
||||||
|
|
||||||
duration += [self sd_frameDurationAtIndex:i source:source];
|
duration += [self sd_frameDurationAtIndex:i source:source];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue