| 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
|
|
|