[FFmpeg-devel] [PATCH] lavf/hlsenc: reuse pattern string, rather than redefining it

Clément Bœsch ubitux at gmail.com
Fri Dec 21 00:50:38 CET 2012


On Fri, Dec 21, 2012 at 12:30:04AM +0100, Stefano Sabatini wrote:
> Improve robustness.
> ---
>  libavformat/hlsenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 07aa4ff..55074c7 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -215,7 +215,7 @@ static int hls_write_header(AVFormatContext *s)
>      if (p)
>          *p = '\0';
>  
> -    av_strlcat(hls->basename, "%d.ts", basename_size);
> +    av_strlcat(hls->basename, pattern, basename_size);
>  
>      if ((ret = hls_mux_init(s)) < 0)
>          goto fail;

pattern is currently a RO string, but it's not sure to stay as such in the
future; some compilers might complain about security concerns. I think
using a PATTERN macro would be safer.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121221/20cb51f4/attachment.asc>


More information about the ffmpeg-devel mailing list