提交 57ae94a3 编写于 作者: S Steven Liu

avformat/hlsenc: fix Explicit null dereferenced in hlsenc

CID: 1398228
Passing null pointer dirname to strlen, which dereferences it.
Reviewed-by: NMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: NSteven Liu <lq@chinaffmpeg.org>
上级 fd0716b3
......@@ -285,8 +285,8 @@ static int hls_delete_old_segments(HLSContext *hls) {
path, strerror(errno));
}
if (segment->sub_filename[0] != '\0') {
sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
if ((segment->sub_filename[0] != '\0')) {
sub_path_size = strlen(segment->sub_filename) + 1 + (dirname ? strlen(dirname) : 0);
sub_path = av_malloc(sub_path_size);
if (!sub_path) {
ret = AVERROR(ENOMEM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册