avformat/hlsenc: allocate space for terminating null

Fixes CID #1420394
pull/272/head
Timo Rothenpieler 7 years ago committed by Steven Liu
parent d9ff1e4c8b
commit 3ee63f3fb7
  1. 2
      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);

Loading…
Cancel
Save