diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 1b038b11c9..3299cc6140 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -51,6 +51,8 @@ av_cold int ffv1_common_init(AVCodecContext *avctx) s->picture.f = avcodec_alloc_frame(); s->last_picture.f = av_frame_alloc(); + if (!s->picture.f || !s->last_picture.f) + return AVERROR(ENOMEM); ff_dsputil_init(&s->dsp, avctx); s->width = avctx->width;