You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +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:
@@ -285,8 +285,8 @@ static int hls_delete_old_segments(HLSContext *hls) {
|
|||||||
path, strerror(errno));
|
path, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (segment->sub_filename[0] != '\0') {
|
if ((segment->sub_filename[0] != '\0')) {
|
||||||
sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
|
sub_path_size = strlen(segment->sub_filename) + 1 + (dirname ? strlen(dirname) : 0);
|
||||||
sub_path = av_malloc(sub_path_size);
|
sub_path = av_malloc(sub_path_size);
|
||||||
if (!sub_path) {
|
if (!sub_path) {
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
Reference in New Issue
Block a user