mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/hlsenc: fix Explicit null dereferenced in hlsenc
CID: 1398228 Passing null pointer dirname to strlen, which dereferences it. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
parent
fd0716b364
commit
57ae94a3c0
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user