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

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

Issue 284043003: Looping of animated WebP: Loop count off-by-one (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
diff --git a/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index 196db5d10ab630b3548be615db8bd0996d251550..72c985b87054641b0e3add764c67523dcd1c20b0 100644
--- a/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -229,8 +229,7 @@ bool WEBPImageDecoder::updateDemuxer()
// This is because ANIM chunk always precedes ANMF chunks.
m_repetitionCount = WebPDemuxGetI(m_demux, WEBP_FF_LOOP_COUNT);
ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff)); // Loop count is always <= 16 bits.
- if (!m_repetitionCount)
- m_repetitionCount = cAnimationLoopInfinite;
+ --m_repetitionCount; // Animation plays 'm_repetitionCount + 1' times.
Peter Kasting 2014/05/14 21:47:04 Nit: This is subtle and deserves more comments:
urvang (Google) 2014/05/14 22:19:50 Done.
m_haveReadAnimationParameters = true;
}

Powered by Google App Engine
This is Rietveld 408576698