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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.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/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index fae908a78e567ec303b4b967a767735cffe0861c..d347c85b1ab32a9ce7dc45f84aa7bcf71bd3adb8 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -166,14 +166,15 @@ int WEBPImageDecoder::repetitionCount() const
return failed() ? cAnimationLoopOnce : m_repetitionCount;
}
-bool WEBPImageDecoder::frameIsCompleteAtIndex(size_t index) const
+bool WEBPImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const
{
- if (!m_demux || m_demuxState <= WEBP_DEMUX_PARSING_HEADER)
- return false;
+ DCHECK(haveUpdatedFrameCount());
if (!(m_formatFlags & ANIMATION_FLAG))
- return ImageDecoder::frameIsCompleteAtIndex(index);
- bool frameIsLoadedAtIndex = index < m_frameBufferCache.size();
- return frameIsLoadedAtIndex;
+ return ImageDecoder::frameIsFullyReceivedAtIndex(index);
+
+ // Multi-frame WebP frame gets added to m_frameBufferCache through
+ // initializeNewFrame() only when the frame data is fully received.
+ return index < m_frameBufferCache.size();
}
float WEBPImageDecoder::frameDurationAtIndex(size_t index) const

Powered by Google App Engine
This is Rietveld 408576698