From 3914c8e0e6bac4ce3b3573c6fd3098e2aa4c9ff5 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Mon, 26 Mar 2018 20:32:00 +0800 Subject: avformat/hlsenc: initialize saveptrs av_strtok calls strspn on a non-NULL *saveptr, so not NULL initializing it is an issue. Fixes CID #1428568 Reviewed-by: Karthick Jeyapal Signed-off-by: Steven Liu Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat/hlsenc.c') diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 34fa8484..2a54b43 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -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; -- cgit v1.1