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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.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/ImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
index 70de78249db332997998e3edd75e1cd5195529e1..d25c4d99d87890c67efc715afd21f1a00bfc9188 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
@@ -144,13 +144,14 @@ ImageFrame* ImageDecoder::frameBufferAtIndex(size_t index)
bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const
{
- return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha();
+ if (m_frameBufferCache.size() == 1)
+ return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha();
+ return !frameIsFullyReceivedAtIndex(index) || m_frameBufferCache[index].hasAlpha();
}
-bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const
+bool ImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const
{
- return (index < m_frameBufferCache.size()) &&
- (m_frameBufferCache[index].getStatus() == ImageFrame::FrameComplete);
+ return (m_isAllDataReceived || failed()) && index < m_frameBufferCache.size();
Peter Kasting 2016/05/25 01:05:23 This implementation worries me. (1) If we call th
aleksandar.stojiljkovic 2016/05/30 16:12:19 The pattern of calling frameCount() looks like the
Peter Kasting 2016/05/31 03:28:26 I guess what I'm saying is that it's dangerous to
scroggo_chromium 2016/06/01 15:11:25 We have a bug filed for the ICO exception: crbug.c
Peter Kasting 2016/06/01 15:23:49 Good find. It would be nice to get that fixed. F
aleksandar.stojiljkovic 2016/06/01 16:21:33 I spent some time thinking about this after initia
aleksandar.stojiljkovic 2016/06/01 16:21:33 I'll take the ICO case separately - starting work
aleksandar.stojiljkovic 2016/06/01 22:47:35 Done - assertion added. Calling non const (e.g.fra
aleksandar.stojiljkovic 2016/06/06 14:26:38 Changed my mind - an attempt to implement ICO supp
}
size_t ImageDecoder::frameBytesAtIndex(size_t index) const

Powered by Google App Engine
This is Rietveld 408576698