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

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: BMPDecoder + remove partial 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..f8c047cc089b42d01dbc62190ef456402a89b5c0 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,11 @@ 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);
+ return ((m_formatFlags & ANIMATION_FLAG) && index < m_frameBufferCache.size()) || ImageDecoder::frameIsFullyReceivedAtIndex(index);
scroggo_chromium 2016/05/16 20:32:08 I brought this up previously, but I don't think yo
aleksandar.stojiljkovic 2016/05/22 15:41:53 I refactored it a bit, but it is still based on in
scroggo_chromium 2016/05/23 16:40:42 That's not obvious to me. An entry is created base
aleksandar.stojiljkovic 2016/05/24 11:08:24 This confused me too. Notice in WEBPImageDecoder::
scroggo_chromium 2016/05/24 13:55:14 Very confusing. Can you add a comment?
aleksandar.stojiljkovic 2016/05/24 19:24:34 Done.
}
float WEBPImageDecoder::frameDurationAtIndex(size_t index) const
@@ -500,7 +497,7 @@ bool WEBPImageDecoder::decodeSingleFrame(const uint8_t* dataBytes, size_t dataSi
clearDecoder();
return true;
case VP8_STATUS_SUSPENDED:
- if (!isAllDataReceived() && !frameIsCompleteAtIndex(frameIndex)) {
+ if (!isAllDataReceived() && !frameIsFullyReceivedAtIndex(frameIndex)) {
applyPostProcessing(frameIndex);
return false;
}

Powered by Google App Engine
This is Rietveld 408576698