diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2011-01-24 12:06:29 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-01-25 16:05:53 (GMT) |
commit | 259ece8b7b78ebe6ef05ce140a83ebab284995a9 (patch) | |
tree | 6150a649887971471b0a6bd0d08adb310bf3cb63 /src | |
parent | 1f225236d1b1497ad3cd7742f9a659beeff272bc (diff) | |
download | Qt-259ece8b7b78ebe6ef05ce140a83ebab284995a9.zip Qt-259ece8b7b78ebe6ef05ce140a83ebab284995a9.tar.gz Qt-259ece8b7b78ebe6ef05ce140a83ebab284995a9.tar.bz2 |
Fix loop count in animanted gifs sometimes being incorrect
Applied patch supplied in QT-4426, which also completes
https://bugs.webkit.org/show_bug.cgi?id=36818
Task-number: QT-4426
Reviewed-by: Kim Motoyoshi Kalland <kim.kalland@nokia.com>
(cherry picked from commit 14e7c8bf3982d05f6fc5c744ebbad791db6ab191)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qgifhandler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/image/qgifhandler.cpp b/src/gui/image/qgifhandler.cpp index 4dd4743..7cb7373 100644 --- a/src/gui/image/qgifhandler.cpp +++ b/src/gui/image/qgifhandler.cpp @@ -1046,7 +1046,7 @@ QGifHandler::QGifHandler() { gifFormat = new QGIFFormat; nextDelay = 100; - loopCnt = 1; + loopCnt = -1; frameNumber = -1; scanIsCached = false; } @@ -1192,7 +1192,13 @@ int QGifHandler::loopCount() const QGIFFormat::scan(device(), &imageSizes, &loopCnt); scanIsCached = true; } - return loopCnt-1; // In GIF, loop count is iteration count, so subtract one + + if (loopCnt == 0) + return -1; + else if (loopCnt == -1) + return 0; + else + return loopCnt; } int QGifHandler::currentImageNumber() const |