From: Flavio Date: Mon, 9 May 2011 10:29:44 +0000 (+0200) Subject: Fixed crash on video error X-Git-Tag: 1.4.3~11 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5e8bdce712d9d0d09a80a91bbb313555acf60ef7;p=minitube Fixed crash on video error --- diff --git a/src/MediaView.cpp b/src/MediaView.cpp index 9d5c684..66fc5ec 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -414,6 +414,10 @@ void MediaView::downloadStatusChanged() { void MediaView::startPlaying() { if (reallyStopped) return; + if (!downloadItem) { + skip(); + return; + } // go! qDebug() << "Playing" << downloadItem->currentFilename(); diff --git a/src/video.cpp b/src/video.cpp index df2c9fe..545c298 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -169,6 +169,7 @@ void Video::gotVideoInfo(QByteArray data) { int previousIndex = 0; while (currentIndex >= 0) { previousIndex = currentIndex - 1; + if (previousIndex < 0) previousIndex = 0; int definitionCode = definitionCodes.at(previousIndex); if (urlMap.contains(definitionCode)) { qDebug() << "Found format" << definitionCode;