[vlc-devel] [PATCHv3 14/17] lib: media_player: fix wrong assert

Thomas Guillem thomas at gllm.fr
Wed Jun 10 14:57:53 CEST 2020


---
 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 c512a04f114..d33a1b5b5cb 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;
-- 
2.20.1



More information about the vlc-devel mailing list