diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-07-24 13:07:51 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-07-24 13:07:51 (GMT) |
commit | e4c3734d31dd4f76c96b0b8f7607347aeea328c3 (patch) | |
tree | bda941e921c3100e4fd421ef58df245cc1bfa35c | |
parent | 42c8c59a7be5e1906de09b6a007b868c897ab9e1 (diff) | |
download | Qt-e4c3734d31dd4f76c96b0b8f7607347aeea328c3.zip Qt-e4c3734d31dd4f76c96b0b8f7607347aeea328c3.tar.gz Qt-e4c3734d31dd4f76c96b0b8f7607347aeea328c3.tar.bz2 |
Musicplayer example crashes when trying to open unvalid file
Reason: Example tries to get media from QList with an index out of
bounds. Nothing to do with Phonon.
Task-number: 253307
-rw-r--r-- | examples/phonon/musicplayer/mainwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/phonon/musicplayer/mainwindow.cpp b/examples/phonon/musicplayer/mainwindow.cpp index a9bb379..ccea606 100644 --- a/examples/phonon/musicplayer/mainwindow.cpp +++ b/examples/phonon/musicplayer/mainwindow.cpp @@ -157,9 +157,12 @@ void MainWindow::tableClicked(int row, int /* column */) mediaObject->stop(); mediaObject->clearQueue(); + if (row >= sources.size()) + return; + mediaObject->setCurrentSource(sources[row]); - if (wasPlaying) + if (wasPlaying) mediaObject->play(); else mediaObject->stop(); |