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)); |