[FFmpeg-devel] [PATCH] avformat/hlsenc: check dirname before use it

Steven Liu lq at chinaffmpeg.org
Fri Nov 2 07:37:49 EET 2018


fix ticket: 7527

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/hlsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f8f060d065..3e4f2b6c8b 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -461,7 +461,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
         char * r_dirname = dirname;
 
         /* if %v is present in the file's directory */
-        if (av_stristr(dirname, "%v")) {
+        if (dirname && av_stristr(dirname, "%v")) {
 
             if (replace_int_data_in_filename(&r_dirname, dirname, 'v', segment->var_stream_idx) < 1) {
                 ret = AVERROR(EINVAL);
-- 
2.15.2 (Apple Git-101.1)





More information about the ffmpeg-devel mailing list