[FFmpeg-devel] [PATCH v1 4/4] avformat/hlsenc: use av_asprintf()
Steven Liu
lq at chinaffmpeg.org
Sun Mar 29 11:32:16 EEST 2020
> 2020年3月26日 下午9:57,lance.lmwang at gmail.com 写道:
>
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> libavformat/hlsenc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index d7b9c0e20a..694dab42dd 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2950,13 +2950,11 @@ static int hls_init(AVFormatContext *s)
> if (ret < 0)
> goto fail;
> } else {
> - vs->vtt_m3u8_name = av_malloc(vtt_basename_size);
> + vs->vtt_m3u8_name = av_asprintf("%s_vtt.m3u8", vs->vtt_basename);
> if (!vs->vtt_m3u8_name) {
> ret = AVERROR(ENOMEM);
> goto fail;
> }
> - strcpy(vs->vtt_m3u8_name, vs->vtt_basename);
> - av_strlcat(vs->vtt_m3u8_name, "_vtt.m3u8", vtt_basename_size);
> }
> av_strlcat(vs->vtt_basename, vtt_pattern, vtt_basename_size);
> }
> --
> 2.21.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
LGTM
Thanks
Steven Liu
More information about the ffmpeg-devel
mailing list