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

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

Issue 1962563002: Fix ImageDecoder::frameIsCompleteAtIndex - fully received instead of decoded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
Index: third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
index 2cae67e0a9f1d413a973a22988c768fe3a689094..03668a73b66cf3fd279f7daa690159709dbeee8e 100644
--- a/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -83,9 +83,11 @@ int GIFImageDecoder::repetitionCount() const
return m_repetitionCount;
}
-bool GIFImageDecoder::frameIsCompleteAtIndex(size_t index) const
+bool GIFImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const
{
- return m_reader && (index < m_reader->imagesCount()) && m_reader->frameContext(index)->isComplete();
+ DCHECK(haveUpdatedFrameCount());
+ return (m_reader && (index < m_reader->imagesCount()) && m_reader->frameContext(index)->isComplete())
+ || ImageDecoder::frameIsFullyReceivedAtIndex(index);
}
float GIFImageDecoder::frameDurationAtIndex(size_t index) const
@@ -296,8 +298,7 @@ void GIFImageDecoder::initializeNewFrame(size_t index)
void GIFImageDecoder::decode(size_t index)
{
- parse(GIFFrameCountQuery);
-
+ DCHECK(haveUpdatedFrameCount());
if (failed())
return;

Powered by Google App Engine
This is Rietveld 408576698