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

Unified Diff: Source/platform/graphics/BitmapImageTest.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
« no previous file with comments | « Source/platform/graphics/BitmapImage.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/BitmapImageTest.cpp
diff --git a/Source/platform/graphics/BitmapImageTest.cpp b/Source/platform/graphics/BitmapImageTest.cpp
index f81655536d7146fcca223efddd92327ad916715b..57d32f0461835474ca51601183db55ddbf2db67e 100644
--- a/Source/platform/graphics/BitmapImageTest.cpp
+++ b/Source/platform/graphics/BitmapImageTest.cpp
@@ -106,6 +106,11 @@ public:
m_image->advanceAnimation(0);
}
+ PassRefPtr<Image> imageForDefaultFrame()
+ {
+ return m_image->imageForDefaultFrame();
+ }
+
protected:
virtual void SetUp() OVERRIDE
{
@@ -230,6 +235,13 @@ TEST_F(BitmapImageTest, webpHasColorProfile)
EXPECT_FALSE(m_image->hasColorProfile());
}
+TEST_F(BitmapImageTest, icoHasWrongFrameDimensions)
+{
+ loadImage("/LayoutTests/fast/images/resources/wrong-frame-dimensions.ico");
+ // This call would cause crash without fix for 408026
+ imageForDefaultFrame();
+}
+
#endif // USE(QCMSLIB)
} // namespace blink
« no previous file with comments | « Source/platform/graphics/BitmapImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698