summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-06-02 23:36:54 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-06-13 06:59:19 +0800
commitd3b29612009b65a83e626ef8800abc244df80f97 (patch)
treee4b13d58a55e46ddc1167628300788e993a46d3a /libavcodec/mpegvideo.c
parent44863b2c2d5a31d82aafa71cdbd180d6bfbed5b4 (diff)
avcodec/mpegvideo: simplify check for av_frame_alloc
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index eb73198b75..d3327e47cc 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -941,17 +941,10 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
if (!s->picture[i].f)
goto fail_nomem;
}
- s->next_picture.f = av_frame_alloc();
- if (!s->next_picture.f)
- goto fail_nomem;
- s->last_picture.f = av_frame_alloc();
- if (!s->last_picture.f)
- goto fail_nomem;
- s->current_picture.f = av_frame_alloc();
- if (!s->current_picture.f)
- goto fail_nomem;
- s->new_picture.f = av_frame_alloc();
- if (!s->new_picture.f)
+ if (!(s->next_picture.f = av_frame_alloc()) ||
+ !(s->last_picture.f = av_frame_alloc()) ||
+ !(s->current_picture.f = av_frame_alloc()) ||
+ !(s->new_picture.f = av_frame_alloc()))
goto fail_nomem;
if ((ret = init_context_frame(s)))