| Index: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
|
| index 960d5e02be9d121765d633d53abe90b32cf7a90e..3efea7f5922053b6ddbd857b0ae7c4f1f6a7e739 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
|
| @@ -84,18 +84,22 @@ String DeferredImageDecoder::filenameExtension() const
|
|
|
| PassRefPtr<SkImage> DeferredImageDecoder::createFrameAtIndex(size_t index)
|
| {
|
| + if (m_frameGenerator && m_frameGenerator->decodeFailed())
|
| + return nullptr;
|
| +
|
| prepareLazyDecodedFrames();
|
|
|
| if (index < m_frameData.size()) {
|
| + FrameData* frameData = &m_frameData[index];
|
| // ImageFrameGenerator has the latest known alpha state. There will be a
|
| // performance boost if this frame is opaque.
|
| - FrameData* frameData = &m_frameData[index];
|
| + ASSERT(m_frameGenerator);
|
| frameData->m_hasAlpha = m_frameGenerator->hasAlpha(index);
|
| frameData->m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData);
|
| return createFrameImageAtIndex(index, !frameData->m_hasAlpha);
|
| }
|
|
|
| - if (!m_actualDecoder)
|
| + if (!m_actualDecoder || m_actualDecoder->failed())
|
| return nullptr;
|
|
|
| ImageFrame* frame = m_actualDecoder->frameBufferAtIndex(index);
|
|
|