From 179d955075b395c09be10c45050450dd19c6cfa2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 28 Mar 2016 17:05:53 +0200 Subject: [PATCH] src/gui/movieplayer.cpp fi possible segaults --- src/gui/movieplayer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5667ed958..749584f85 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -502,9 +502,11 @@ bool CMoviePlayerGui::prepareFile(CFile *file) if (isMovieBrowser) { if (filelist_it != filelist.end()) { unsigned idx = filelist_it - filelist.begin(); - p_movie_info = milist[idx]; - startposition = p_movie_info->bookmarks.start > 0 ? p_movie_info->bookmarks.start*1000 : -1; - printf("CMoviePlayerGui::prepareFile: file %s start %d\n", file_name.c_str(), startposition); + if(milist.size() > idx){ + p_movie_info = milist[idx]; + startposition = p_movie_info->bookmarks.start > 0 ? p_movie_info->bookmarks.start*1000 : -1; + printf("CMoviePlayerGui::prepareFile: file %s start %d\n", file_name.c_str(), startposition); + } } if (isYT) { file_name = file->Url; @@ -1643,7 +1645,8 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) if (vzap_it <= filelist.end()) { unsigned idx = vzap_it - filelist.begin(); //printf("CMoviePlayerGui::%s: idx: %d\n", __func__, idx); - mi = milist[idx]; + if(milist.size() > idx) + mi = milist[idx]; } } g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1,