[videodb] fix crash linking a movie to a show if there's no tvshows left to link.
authorJonathan Marshall <jmarshall@xbmc.org>
Sun, 30 Mar 2014 07:24:35 +0000 (20:24 +1300)
committerJonathan Marshall <jmarshall@xbmc.org>
Mon, 31 Mar 2014 04:55:55 +0000 (17:55 +1300)
xbmc/video/dialogs/GUIDialogVideoInfo.cpp

index fbf2146..fa1a7e2 100644 (file)
@@ -1929,7 +1929,7 @@ bool CGUIDialogVideoInfo::LinkMovieToTvShow(const CFileItemPtr &item, bool bRemo
     iSelectedLabel = pDialog->GetSelectedLabel();
   }
 
-  if (iSelectedLabel > -1)
+  if (iSelectedLabel > -1 && iSelectedLabel < list.Size())
     return database.LinkMovieToTvshow(dbId, list[iSelectedLabel]->GetVideoInfoTag()->m_iDbId, bRemove);
 
   return false;