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

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

Issue 1527433002: Deferred GIF image decodes should report decode failures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years 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: 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 0005bb593bec3b589d7682418afa8729be319ffe..9cf310aec72e7ea3908bc4ccdc73b436d14397e6 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);

Powered by Google App Engine
This is Rietveld 408576698