summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-10-08 13:16:00 +0200
committerLars Knoll <lars.knoll@qt.io>2019-10-09 15:58:26 +0200
commitba26496647bca4b37fc2319b553b95966823b941 (patch)
tree8db936484d2042693a40e9b1074946cbcf3a2b3d /src/gui/image
parent8c092570fcd1330dd916f31d46e8472b7817ec80 (diff)
Don't crash when calling jumpToFrame() on an empty QMovie
Properly return an invalid frame when calling jumpToFrame() with a non existent frame number. Fixes: QTBUG-79029 Change-Id: Ic40f4a6de3106fab42c0bb6c961194be47b04e31 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qmovie.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index 79203c7b98..f03c8836df 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -416,7 +416,7 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber)
} else {
// We've read all frames now. Return an end marker
haveReadAll = true;
- return QFrameInfo::endMarker();
+ return frameNumber == greatestFrameNumber + 1 ? QFrameInfo::endMarker() : QFrameInfo();
}
}
}