[FFmpeg-cvslog] lavf/vividas: check avformat_new_stream() return

Jun Zhao git at videolan.org
Fri Nov 29 04:11:47 EET 2019


ffmpeg | branch: master | Jun Zhao <barryjzhao at tencent.com> | Thu Nov 28 19:07:48 2019 +0800| [d96558902277a25e002ad1b9bb9bc7e536a13a8b] | committer: Jun Zhao

lavf/vividas: check avformat_new_stream() return

check avformat_new_stream() return.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d96558902277a25e002ad1b9bb9bc7e536a13a8b
---

 libavformat/vividas.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 88fa89a3cf..4ea29d85e3 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -317,6 +317,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s,  uint8_t *
 
     for (i = 0; i < num_video; i++) {
         AVStream *st = avformat_new_stream(s, NULL);
+        if (!st)
+            return AVERROR(ENOMEM);
 
         st->id = i;
 
@@ -350,6 +352,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s,  uint8_t *
     for(i=0;i<viv->num_audio;i++) {
         int q;
         AVStream *st = avformat_new_stream(s, NULL);
+        if (!st)
+            return AVERROR(ENOMEM);
 
         st->id = num_video + i;
 



More information about the ffmpeg-cvslog mailing list