summaryrefslogtreecommitdiff
path: root/libavformat/vividas.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-11-28 19:07:48 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-11-29 10:09:29 +0800
commitd96558902277a25e002ad1b9bb9bc7e536a13a8b (patch)
treeef84294dc4da1c406822d29263cb2a417df13869 /libavformat/vividas.c
parentc1ed00fd185e347032bbe23b42f66ce027bbecce (diff)
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>
Diffstat (limited to 'libavformat/vividas.c')
-rw-r--r--libavformat/vividas.c4
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;