[vlc-commits] commit: ALSA: 16-bytes is enough for a card name ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Jul 18 17:52:32 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 18 18:01:06 2010 +0300| [756890613a5236cf9145331c531a6add6c847878] | committer: Rémi Denis-Courmont 

ALSA: 16-bytes is enough for a card name

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

 modules/audio_output/alsa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 4aa70fd..62693b3 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -972,10 +972,10 @@ static void GetDevicesForCard( vlc_object_t *obj, module_config_t *p_item,
     int i_err = 0;
     snd_pcm_info_t *p_pcm_info;
     snd_ctl_t *p_ctl;
-    char psz_dev[64];
+    char psz_dev[4 + 3 * sizeof(int)];
     char *psz_card_name;
 
-    sprintf( psz_dev, "hw:%i", i_card );
+    snprintf( psz_dev, sizeof (psz_dev), "hw:%u", i_card );
 
     if( ( i_err = snd_ctl_open( &p_ctl, psz_dev, 0 ) ) < 0 )
         return;



More information about the vlc-commits mailing list