diff options
author | Jun Zhao <barryjzhao@tencent.com> | 2019-11-28 19:07:48 +0800 |
---|---|---|
committer | Jun Zhao <barryjzhao@tencent.com> | 2019-11-29 10:09:29 +0800 |
commit | d96558902277a25e002ad1b9bb9bc7e536a13a8b (patch) | |
tree | ef84294dc4da1c406822d29263cb2a417df13869 | |
parent | c1ed00fd185e347032bbe23b42f66ce027bbecce (diff) | |
download | ffmpeg-d96558902277a25e002ad1b9bb9bc7e536a13a8b.tar.gz |
lavf/vividas: check avformat_new_stream() return
check avformat_new_stream() return.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
-rw-r--r-- | libavformat/vividas.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |