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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 1780463007: WebP animation: Loop once more than stored loop count. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gif_loop_fix
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 898332b5e951c998d4d17d9678e955ae314db8f9..9cb2df5d8a0ff1a52a7f91848d1b627baa094f07 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -227,12 +227,8 @@ bool WEBPImageDecoder::updateDemuxer()
m_repetitionCount = WebPDemuxGetI(m_demux, WEBP_FF_LOOP_COUNT);
// Repetition count is always <= 16 bits.
ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff));
- // Repetition count is the number of animation cycles to show,
- // where 0 means "infinite". But ImageSource::repetitionCount()
- // returns -1 for "infinite", and 0 and up for "show the image
- // animation one cycle more than the value". Subtract one here
- // to correctly handle the finite and infinite cases.
- --m_repetitionCount;
+ if (!m_repetitionCount)
+ m_repetitionCount = cAnimationLoopInfinite;
// FIXME: Implement ICC profile support for animated images.
m_formatFlags &= ~ICCP_FLAG;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698