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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp

Issue 1460523002: GIF decoding to Index8, unit tests and misusing unit test as benchmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skia:onGetColorType related implementation. Fix part of Leon's review comments. 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/image-decoders/gif/GIFImageReader.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp
index 39ce3346c3a9347f17284c59b19bf5515b5b7f8c..632e5a1cfb627e493863f3609a655e02cbd15588 100644
--- a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp
@@ -343,6 +343,11 @@ bool GIFFrameContext::decode(blink::FastSharedBufferReader* reader, blink::GIFIm
m_currentLzwBlock = 0;
}
+ if (m_lzwContext->hasRemainingRows()) {
+ if (!client->initFrameBuffer(m_frameId))
+ return false;
+ }
+
// Some bad GIFs have extra blocks beyond the last row, which we don't want to decode.
while (m_currentLzwBlock < m_lzwBlocks.size() && m_lzwContext->hasRemainingRows()) {
size_t blockPosition = m_lzwBlocks[m_currentLzwBlock].blockPosition;

Powered by Google App Engine
This is Rietveld 408576698