From 5e8bdce712d9d0d09a80a91bbb313555acf60ef7 Mon Sep 17 00:00:00 2001 From: Flavio Date: Mon, 9 May 2011 12:29:44 +0200 Subject: [PATCH] Fixed crash on video error --- src/MediaView.cpp | 4 ++++ src/video.cpp | 1 + 2 files changed, 5 insertions(+) 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; -- 2.39.5