avformat/hlsenc: allocate space for terminating null

Fixes CID #1420394
This commit is contained in:
Timo Rothenpieler 2017-11-13 10:44:16 +08:00 committed by Steven Liu
parent d9ff1e4c8b
commit 3ee63f3fb7
1 changed files with 1 additions and 1 deletions

View File

@ -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);