Commit d80fe5d4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/vb: Check for av_mallocz() failure

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 694671bc
......@@ -251,6 +251,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->frame = av_mallocz(avctx->width * avctx->height);
c->prev_frame = av_mallocz(avctx->width * avctx->height);
if (!c->frame || !c->prev_frame) {
av_freep(&c->frame);
av_freep(&c->prev_frame);
return AVERROR(ENOMEM);
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment