summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2011-01-24 12:06:29 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2011-01-24 12:06:29 (GMT)
commit14e7c8bf3982d05f6fc5c744ebbad791db6ab191 (patch)
tree692529f7a5e249e741937705a14b5ba025c8fba5 /src
parentc6137472df3ef7799d41cee1af2f8efa86e702cf (diff)
downloadQt-14e7c8bf3982d05f6fc5c744ebbad791db6ab191.zip
Qt-14e7c8bf3982d05f6fc5c744ebbad791db6ab191.tar.gz
Qt-14e7c8bf3982d05f6fc5c744ebbad791db6ab191.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>
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qgifhandler.cpp10
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