diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-17 11:46:44 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-12-22 13:47:40 (GMT) |
commit | ce432e1799111cbed492e46bb62d8dfb40585a10 (patch) | |
tree | 0175c56ec0fcd84a07e892b8deb6b52948493f48 /src | |
parent | a562fd2d201e3b618ed99a316275f20385cc5c25 (diff) | |
download | Qt-ce432e1799111cbed492e46bb62d8dfb40585a10.zip Qt-ce432e1799111cbed492e46bb62d8dfb40585a10.tar.gz Qt-ce432e1799111cbed492e46bb62d8dfb40585a10.tar.bz2 |
Prevented infinite loop in QMoviePrivate::next().
If we're unable to read the first frame, we shouldn't return an end
marker, as that will cause QMoviePrivate::next() to recurse
indefinitely when the playCounter is set to -1 (infinite).
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qmovie.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp index 911a2b5..eb139fa 100644 --- a/src/gui/image/qmovie.cpp +++ b/src/gui/image/qmovie.cpp @@ -381,10 +381,14 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber) QPixmap aPixmap = QPixmap::fromImage(anImage); int aDelay = reader->nextImageDelay(); return QFrameInfo(aPixmap, aDelay); - } else { + } else if (frameNumber != 0) { // We've read all frames now. Return an end marker haveReadAll = true; return QFrameInfo::endMarker(); + } else { + // No readable frames + haveReadAll = true; + return QFrameInfo(); } } |