[FFmpeg-devel] [PATCH] avformat/hlsenc: initialize saveptrs

Timo Rothenpieler timo at rothenpieler.org
Wed Mar 21 21:33:50 EET 2018


av_strtok calls strspn on a non-NULL *saveptr, so not NULL initializing it is an issue.

Fixes CID #1428568
---
 libavformat/hlsenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index b7c6fbde6a..fa17776efe 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1873,7 +1873,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;
 
-- 
2.16.2



More information about the ffmpeg-devel mailing list