diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-10-08 13:16:00 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-10-09 15:58:26 +0200 |
commit | ba26496647bca4b37fc2319b553b95966823b941 (patch) | |
tree | 8db936484d2042693a40e9b1074946cbcf3a2b3d /tests/auto | |
parent | 8c092570fcd1330dd916f31d46e8472b7817ec80 (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 'tests/auto')
-rw-r--r-- | tests/auto/gui/image/qmovie/tst_qmovie.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index 4e9e9b8115..c8217b2cec 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -62,6 +62,7 @@ private slots: #ifndef QT_NO_WIDGETS void infiniteLoop(); #endif + void emptyMovie(); }; // Testing get/set functions @@ -220,5 +221,13 @@ void tst_QMovie::infiniteLoop() } #endif +void tst_QMovie::emptyMovie() +{ + QMovie movie; + movie.setCacheMode(QMovie::CacheAll); + movie.jumpToFrame(100); + QCOMPARE(movie.currentFrameNumber(), -1); +} + QTEST_MAIN(tst_QMovie) #include "tst_qmovie.moc" |