vlc | branch: master | Romain Vimont <[email protected]> | Fri Nov 10 22:56:42 2017 +0100| [3ff283bc176b2dd2e83bb7cd7358eb2a0104124c] | committer: 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 segfault. Initialize it to NULL to fix the problem. Signed-off-by: Romain Vimont <[email protected]> Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ff283bc176b2dd2e83bb7cd7358eb2a0104124c --- modules/services_discovery/mtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services_discovery/mtp.c b/modules/services_discovery/mtp.c index 56be3e3f6d..b64f84e3e2 100644 --- a/modules/services_discovery/mtp.c +++ b/modules/services_discovery/mtp.c @@ -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; } else { _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
