Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Unified Diff: Source/platform/graphics/BitmapImage.cpp

Issue 535823002: Don't crash when an image fails to decode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/BitmapImage.cpp
diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
index a3e6d84a5dcb945ec4eec9e51f428c7542ad4b7d..92bbbd0dbc9f4e39f427fcddcbcaef1505b27ea0 100644
--- a/Source/platform/graphics/BitmapImage.cpp
+++ b/Source/platform/graphics/BitmapImage.cpp
@@ -370,7 +370,7 @@ PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame()
PassRefPtr<Image> BitmapImage::imageForDefaultFrame()
{
- if (frameCount() > 1)
+ if (frameCount() > 1 && frameAtIndex(0))
return BitmapImage::create(frameAtIndex(0));
return Image::imageForDefaultFrame();
« no previous file with comments | « LayoutTests/fast/images/resources/wrong-frame-dimensions.ico ('k') | Source/platform/graphics/BitmapImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698