Protect against malformed image

Don’t add nil to the array, just skip the frame.
This commit is contained in:
sukeban 2016-01-25 14:21:17 -08:00
parent 64f621081c
commit 3b039d5910
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@
for (size_t i = 0; i < count; i++) {
CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
if (!image)
continue;
duration += [self sd_frameDurationAtIndex:i source:source];