Commit 3ff283bc authored by Romain Vimont's avatar Romain Vimont Committed by Jean-Baptiste Kempf

mtp: fix initialization to avoid segfault on close

When an Android device is plugged with MTP disabled, the tracks may not
be retrieved.

In that branch of code, pp_items was never initialized, so the behavior
was undefined in CloseDevice() (on device unplug), often causing a

Initialize it to NULL to fix the problem.
Signed-off-by: Romain Vimont's avatarRomain Vimont <>
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent 65135741
......@@ -198,6 +198,7 @@ static int AddDevice( services_discovery_t *p_sd,
CountTracks, p_sd ) ) == NULL )
msg_Warn( p_sd, "No tracks on the device" );
p_sd->p_sys->pp_items = NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment