]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: fix CID 1418106
authorSteven Liu <lq@chinaffmpeg.org>
Thu, 21 Sep 2017 15:08:00 +0000 (23:08 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Thu, 21 Sep 2017 15:08:00 +0000 (23:08 +0800)
fix the "Uninitialized scalar variable (UNINIT)" problem.

Signed-off-by: Steven Liu <lq@onvideo.cn>
libavformat/hlsenc.c

index 3a9a23551463093e884416fee4628e160d9e3b1f..d70a2f7ff6016dbfce876367b739dd02bb3a92d2 100644 (file)
@@ -1327,13 +1327,13 @@ static int hls_write_header(AVFormatContext *s)
 {
     HLSContext *hls = s->priv_data;
     int ret, i;
-    char *p;
+    char *p = NULL;
     const char *pattern = "%d.ts";
     const char *pattern_localtime_fmt = get_default_pattern_localtime_fmt(s);
     const char *vtt_pattern = "%d.vtt";
     AVDictionary *options = NULL;
-    int basename_size;
-    int vtt_basename_size;
+    int basename_size = 0;
+    int vtt_basename_size = 0;
 
     if (hls->segment_type == SEGMENT_TYPE_FMP4) {
         pattern = "%d.m4s";