diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index 40a79000fb..2f2ad8c8db 100644 --- a/libavcodec/audioconvert.c +++ b/libavcodec/audioconvert.c @@ -128,7 +128,7 @@ void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, for (i=0; channel_layout_map[i].name; i++) if (nb_channels == channel_layout_map[i].nb_channels && channel_layout == channel_layout_map[i].layout) { - snprintf(buf, buf_size, channel_layout_map[i].name); + av_strlcpy(buf, channel_layout_map[i].name, buf_size); return; }