diff mbox

[FFmpeg-devel,v1,3/8] avformat/hlsenc: check av_strdup() return value

Message ID 20191010034011.1205-3-lq@chinaffmpeg.org
State New
Headers show

Commit Message

Liu Steven Oct. 10, 2019, 3:40 a.m. UTC
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index eacc438e30..fcc154013c 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2008,6 +2008,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;