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

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

Issue 205333004: Deferred image decoding to handle broken GIFs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | Source/platform/graphics/DeferredImageDecoderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/Source/platform/graphics/DeferredImageDecoder.cpp b/Source/platform/graphics/DeferredImageDecoder.cpp
index 4a350c7064ea6959059a4075ca5c54c60160e4db..f6bb64f4da2b4521a0e0cf245298d8d1348e777f 100644
--- a/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -227,6 +227,11 @@ void DeferredImageDecoder::prepareLazyDecodedFrames()
const size_t previousSize = m_lazyDecodedFrames.size();
m_lazyDecodedFrames.resize(m_actualDecoder->frameCount());
+
+ // We have encountered a broken image file. Simply bail.
+ if (m_lazyDecodedFrames.size() < previousSize)
+ return;
+
for (size_t i = previousSize; i < m_lazyDecodedFrames.size(); ++i) {
OwnPtr<ImageFrame> frame(adoptPtr(new ImageFrame()));
frame->setSkBitmap(createBitmap(i));
« no previous file with comments | « no previous file | Source/platform/graphics/DeferredImageDecoderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698