[FFmpeg-cvslog] avformat/hlsenc: allocate space for terminating null

Timo Rothenpieler git at videolan.org
Thu Nov 16 03:54:52 EET 2017


ffmpeg | branch: release/3.4 | Timo Rothenpieler <timo at rothenpieler.org> | Mon Nov 13 10:44:16 2017 +0800| [62e99f026aea5c5f6c523ed4e870738b99b9c7a4] | committer: Aman Gupta

avformat/hlsenc: allocate space for terminating null

Fixes CID #1420394

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

 libavformat/hlsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 5ea9d216a4..b571772f60 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1455,7 +1455,7 @@ static int hls_write_header(AVFormatContext *s)
             if (basename_size > 0) {
                 hls->base_output_dirname = av_malloc(basename_size);
             } else {
-                hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename));
+                hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename) + 1);
             }
             if (!hls->base_output_dirname) {
                 ret = AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list