[FFmpeg-devel] [PATCH] libavcodec/audioconvert.c: Fix warnings about snprintf formatting

Måns Rullgård mans
Mon Feb 9 21:35:37 CET 2009


Patrik <patrik at yes.nu> writes:

> Current SVN warns:
>
> audioconvert.c: In function ?avcodec_get_channel_layout_string?:
> audioconvert.c:131: warning: format not a string literal and no format
> arguments
> audioconvert.c:131: warning: format not a string literal and no format
> arguments
>
> Patch to fix that.
>
> Index: libavcodec/audioconvert.c
> ===================================================================
> --- libavcodec/audioconvert.c	(revision 17099)
> +++ libavcodec/audioconvert.c	(working copy)
> @@ -128,7 +128,7 @@
>      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);
> +            snprintf(buf, buf_size, "%s", channel_layout_map[i].name);
>              return;

Why not use av_strlcpy() instead?

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list