diff mbox series

[FFmpeg-devel,10/10] avformat/hls: check dynarray_add error when add stream

Message ID tencent_B5E54E80706B2D299A8B40AE9AFF9F43AB08@qq.com
State New
Headers show
Series [FFmpeg-devel,01/10] avformat/hls: fix repeated requests for media init section | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

zhilizhao(赵志立) April 12, 2022, 8:15 a.m. UTC
---
 libavformat/hls.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/hls.c b/libavformat/hls.c
index c102e36f52..4ab565f8e0 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1882,7 +1882,10 @@  static int update_streams_from_subdemuxer(AVFormatContext *s, struct playlist *p
             return AVERROR(ENOMEM);
 
         st->id = pls->index;
-        dynarray_add(&pls->main_streams, &pls->n_main_streams, st);
+        err = av_dynarray_add_nofree(&pls->main_streams, &pls->n_main_streams,
+                                     st);
+        if (err < 0)
+            return err;
 
         add_stream_to_programs(s, pls, st);