From f89940e6d0b3b1ed0225e1f4ae9dce7913f4c84c Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 3 Apr 2008 18:57:26 +0000 Subject: [PATCH] Fixed timing of malformed animated GIFs in wxHTML (patch #1926825 by Gennady Feller) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/m_image.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 85f9fb770f..d2fbb26652 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -388,7 +388,10 @@ wxHtmlImageCell::wxHtmlImageCell(wxHtmlWindowInterface *windowIface, if ( m_gifDecoder->IsAnimation() ) { m_gifTimer = new wxGIFTimer(this); - m_gifTimer->Start(m_gifDecoder->GetDelay(0), true); + long delay = m_gifDecoder->GetDelay(0); + if ( delay == 0 ) + delay = 1; + m_gifTimer->Start(delay, true); } else { @@ -522,7 +525,10 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer) win->Refresh(img.HasMask(), &rect); } - timer->Start(m_gifDecoder->GetDelay(m_nCurrFrame), true); + long delay = m_gifDecoder->GetDelay(m_nCurrFrame); + if ( delay == 0 ) + delay = 1; + timer->Start(delay, true); } void wxHtmlImageCell::Layout(int w) -- 2.45.2