[vlc-commits] lib: media_player: fix wrong assert

Thomas Guillem git at videolan.org
Thu Jun 11 14:45:50 CEST 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun  9 17:29:52 2020 +0200| [c973e161335d129809b47ac4c451877caa6c052d] | committer: Thomas Guillem

lib: media_player: fix wrong assert

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c973e161335d129809b47ac4c451877caa6c052d
---

 lib/media_player.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/media_player.c b/lib/media_player.c
index c512a04f11..d33a1b5b5c 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -335,7 +335,9 @@ on_program_selection_changed(vlc_player_t *player, int unselected_id,
 
     const struct vlc_player_program *program =
         vlc_player_GetSelectedProgram(player);
-    assert(program);
+
+    if (unlikely(program == NULL)) /* can happen when the player is stopping */
+        return;
 
     libvlc_event_t event;
     event.type = libvlc_MediaPlayerScrambledChanged;



More information about the vlc-commits mailing list