summaryrefslogtreecommitdiffstats
path: root/examples/phonon
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-07-24 13:07:51 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-07-24 13:07:51 (GMT)
commite4c3734d31dd4f76c96b0b8f7607347aeea328c3 (patch)
treebda941e921c3100e4fd421ef58df245cc1bfa35c /examples/phonon
parent42c8c59a7be5e1906de09b6a007b868c897ab9e1 (diff)
downloadQt-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
Diffstat (limited to 'examples/phonon')
-rw-r--r--examples/phonon/musicplayer/mainwindow.cpp5
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();