[vlc-commits] [Git][videolan/vlc][master] media_player: fix missing unlock on error

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Feb 20 22:58:16 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
b287ec2c by RĂ©mi Denis-Courmont at 2022-02-20T22:38:26+00:00
media_player: fix missing unlock on error

Fixes #26635.

- - - - -


1 changed file:

- lib/media_player.c


Changes:

=====================================
lib/media_player.c
=====================================
@@ -1710,20 +1710,15 @@ bool libvlc_media_player_can_pause(libvlc_media_player_t *p_mi)
 
 bool libvlc_media_player_program_scrambled(libvlc_media_player_t *p_mi)
 {
+    const struct vlc_player_program *program;
     bool b_program_scrambled = false;
 
     vlc_player_t *player = p_mi->player;
     vlc_player_Lock(player);
-
-    const struct vlc_player_program *program =
-        vlc_player_GetSelectedProgram(player);
-    if (!program)
-        goto end;
-
-    b_program_scrambled = program->scrambled;
-
+    program = vlc_player_GetSelectedProgram(player);
+    if (program != NULL)
+        b_program_scrambled = program->scrambled;
     vlc_player_Unlock(player);
-end:
     return b_program_scrambled;
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b287ec2c5fd65484febc1664fc6839f2da190a93

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b287ec2c5fd65484febc1664fc6839f2da190a93
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list