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

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: Review #23 fix - comments. cleanup. Thanks Leon. Created 4 years, 7 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..b26960203d042666f595674f05a7e2b8be25b5f8 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,14 @@ 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;
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.
Peter Kasting 2016/05/25 01:05:23 Really? That's not what it looks like to me. m_f
aleksandar.stojiljkovic 2016/05/30 16:12:20 Yes, it is like that. I could work on documenting
Peter Kasting 2016/05/31 03:46:42 That looks to me like a bug in the webp decoder, h
scroggo_chromium 2016/06/01 15:11:25 AFAICT, the GIF decoder does not know its frame co
Peter Kasting 2016/06/01 15:23:49 Huh. I was misled by the way there's a separate f
+ return index < m_frameBufferCache.size();
}
float WEBPImageDecoder::frameDurationAtIndex(size_t index) const

Powered by Google App Engine
This is Rietveld 408576698