diff mbox

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

Message ID 20181102053749.57300-1-lq@chinaffmpeg.org
State New
Headers show

Commit Message

Liu Steven Nov. 2, 2018, 5:37 a.m. UTC
fix ticket: 7527

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

Patch

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);