[FFmpeg-cvslog] avformat/hlsenc: use av_asprintf()

Limin Wang git at videolan.org
Wed Apr 8 18:55:14 EEST 2020


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Thu Mar 26 21:57:00 2020 +0800| [99ebb033d21df58b359b496662b066bc48ae6662] | committer: Steven Liu

avformat/hlsenc: use av_asprintf()

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99ebb033d21df58b359b496662b066bc48ae6662
---

 libavformat/hlsenc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 90c5561b4e..a29b2625e4 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2942,13 +2942,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);
         }



More information about the ffmpeg-cvslog mailing list