Skip to content

Commit

Permalink
Protect against malformed image
Browse files Browse the repository at this point in the history
Don’t add nil to the array, just skip the frame.
  • Loading branch information
sukeban committed Jan 25, 2016
1 parent 64f6210 commit 3b039d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SDWebImage/UIImage+GIF.m
Expand Up @@ -32,6 +32,8 @@ + (UIImage *)sd_animatedGIFWithData:(NSData *)data {

for (size_t i = 0; i < count; i++) {
CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
if (!image)
continue;

duration += [self sd_frameDurationAtIndex:i source:source];

Expand Down

0 comments on commit 3b039d5

Please sign in to comment.