]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: check av_strdup() return value
authorSteven Liu <lq@chinaffmpeg.org>
Sat, 19 Oct 2019 04:48:49 +0000 (06:48 +0200)
committerSteven Liu <lq@chinaffmpeg.org>
Sat, 19 Oct 2019 04:48:49 +0000 (06:48 +0200)
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index 5a27b0f65709caa6522f748829f1ca56f6138c61..7b1d54e23e3ae6a5419c50c5e97401a3a3e25ec6 100644 (file)
@@ -1886,6 +1886,9 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
      * agroup: is key to specify audio group. A string can be given as value.
      */
     p = av_strdup(hls->var_stream_map);
+    if (!p)
+        return AVERROR(ENOMEM);
+
     q = p;
     while (av_strtok(q, " \t", &saveptr1)) {
         q = NULL;
@@ -2007,6 +2010,9 @@ static int parse_cc_stream_mapstring(AVFormatContext *s)
     ClosedCaptionsStream *ccs;
 
     p = av_strdup(hls->cc_stream_map);
+    if(!p)
+        return AVERROR(ENOMEM);
+
     q = p;
     while (av_strtok(q, " \t", &saveptr1)) {
         q = NULL;