avformat/hlsenc: initialize saveptrs
authorTimo Rothenpieler <timo@rothenpieler.org>
Mon, 26 Mar 2018 12:32:00 +0000 (20:32 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Mon, 26 Mar 2018 22:56:27 +0000 (06:56 +0800)
av_strtok calls strspn on a non-NULL *saveptr, so not NULL initializing
it is an issue.
Fixes CID #1428568

Reviewed-by: Karthick Jeyapal <kjeyapal@akamai.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index 34fa848..2a54b43 100644 (file)
@@ -1888,7 +1888,8 @@ static int parse_cc_stream_mapstring(AVFormatContext *s)
 {
     HLSContext *hls = s->priv_data;
     int nb_ccstreams;
-    char *p, *q, *saveptr1, *saveptr2, *ccstr, *keyval;
+    char *p, *q, *ccstr, *keyval;
+    char *saveptr1 = NULL, *saveptr2 = NULL;
     const char *val;
     ClosedCaptionsStream *ccs;