summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2019-10-19 06:48:49 +0200
committerSteven Liu <lq@chinaffmpeg.org>2019-10-19 06:48:49 +0200
commit17d96c15d25e0998770f36e6f93d01014dd65f6c (patch)
treec2b77ba12c9b03b6f1748bf66a988b7984a73377 /libavformat/hlsenc.c
parent25f5d67a316b6868b4358e0b908bc19f00b9d357 (diff)
avformat/hlsenc: check av_strdup() return value
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 5a27b0f657..7b1d54e23e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -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;