From dbe1593af6bfb54460d249f960936f1378224eb8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 28 Oct 2018 06:34:13 -0300 Subject: vlcmediawidget: Set vlcMedia to NULL after release As we're now calling the code at makePlay() on two different places, we should ensure that it will only work if vlcMedia was created. Without that, if someone tries to play an audio CD and it fails for whatever reason (like if the system doesn't have a CD device), it crashes. Signed-off-by: Mauro Carvalho Chehab --- src/backend-vlc/vlcmediawidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend-vlc/vlcmediawidget.cpp b/src/backend-vlc/vlcmediawidget.cpp index 1f5d61d..e7bc801 100644 --- a/src/backend-vlc/vlcmediawidget.cpp +++ b/src/backend-vlc/vlcmediawidget.cpp @@ -353,6 +353,7 @@ void VlcMediaWidget::makePlay() libvlc_media_player_set_media(vlcMediaPlayer, vlcMedia); libvlc_media_release(vlcMedia); + vlcMedia = NULL; if (libvlc_media_player_play(vlcMediaPlayer) != 0) return; -- cgit v0.11.2