[vlc-commits] lib: fix libvlc_audio_output_device_list_get() crash

Rémi Denis-Courmont git at videolan.org
Wed Feb 28 20:02:43 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 28 20:50:25 2018 +0200| [75781357896c497829de461192f0223c96e00e29] | committer: Rémi Denis-Courmont

lib: fix libvlc_audio_output_device_list_get() crash

Only query the list of audio devices if the specified module/option
exists, and it is a string.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=75781357896c497829de461192f0223c96e00e29
---

 lib/audio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/audio.c b/lib/audio.c
index 3aed6f5ff3..877666473a 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -189,6 +189,9 @@ libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance,
                                                            >= sizeof(varname) )
         return NULL;
 
+    if( config_GetType(varname) != VLC_VAR_STRING )
+        return NULL;
+
     libvlc_audio_output_device_t *list = NULL, **pp = &list;
     char **values, **texts;
     ssize_t count = config_GetPszChoices( VLC_OBJECT(p_instance->p_libvlc_int),



More information about the vlc-commits mailing list