diff --git a/SDWebImage/SDWebImageDecoder.m b/SDWebImage/SDWebImageDecoder.m index a7c02468..2d3b5e26 100644 --- a/SDWebImage/SDWebImageDecoder.m +++ b/SDWebImage/SDWebImageDecoder.m @@ -19,6 +19,11 @@ // when there are memory warning. // on iOS7, do not forget to call // [[SDImageCache sharedImageCache] clearMemory]; + + if (image == nil) { // Prevent "CGBitmapContextCreateImage: invalid context 0x0" error + return nil; + } + @autoreleasepool{ // do not decode animated images if (image.images) { return image; }