[vlc-devel] [PATCH] player: fix null-deref with corks callbacks

Thomas Guillem thomas at gllm.fr
Thu Mar 19 14:14:24 CET 2020


---
 src/player/player.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/player/player.c b/src/player/player.c
index 38c9b5aa57..a1a39a28f5 100644
--- a/src/player/player.c
+++ b/src/player/player.c
@@ -1911,7 +1911,7 @@ vlc_player_Delete(vlc_player_t *player)
     vlc_player_DestroyTimer(player);
 
     vlc_player_aout_DelCallbacks(player);
-    var_DelCallback(player, "corks", vlc_player_CorkCallback, NULL);
+    var_DelCallback(player, "corks", vlc_player_CorkCallback, player);
 
     input_resource_Release(player->resource);
     if (player->renderer)
@@ -2005,7 +2005,7 @@ vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type,
         vlc_player_aout_AddCallbacks(player);
         input_resource_PutAout(player->resource, aout);
     }
-    var_AddCallback(player, "corks", vlc_player_CorkCallback, NULL);
+    var_AddCallback(player, "corks", vlc_player_CorkCallback, player);
 
     player->deleting = false;
     vlc_player_InitLocks(player, lock_type);
@@ -2023,7 +2023,7 @@ vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type,
 error:
     if (aout)
         vlc_player_aout_DelCallbacks(player);
-    var_DelCallback(player, "corks", vlc_player_CorkCallback, NULL);
+    var_DelCallback(player, "corks", vlc_player_CorkCallback, player);
     if (player->resource)
         input_resource_Release(player->resource);
 
-- 
2.20.1



More information about the vlc-devel mailing list