summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2021-04-10 11:59:00 +0200
committerMarton Balint <cus@passwd.hu>2021-04-18 17:25:51 +0200
commit28c83584e8f3cd747c1476a74cc2841d3d1fa7f3 (patch)
treeb28139f6658868a6c23537500c9b6539b6672e88 /libavformat/hls.c
parent988f2e9eb063db7c1a678729f58aab6eba59a55b (diff)
downloadffmpeg-28c83584e8f3cd747c1476a74cc2841d3d1fa7f3.tar.gz
avformat/hls: check return value of new_init_section()
Fixes part of ticket #8931. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 597bea7f25..b589ad2870 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -842,6 +842,10 @@ static int parse_playlist(HLSContext *c, const char *url,
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_init_section_args,
&info);
cur_init_section = new_init_section(pls, &info, url);
+ if (!cur_init_section) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
cur_init_section->key_type = key_type;
if (has_iv) {
memcpy(cur_init_section->iv, iv, sizeof(iv));