1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/vb: Check for av_mallocz() failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-09 09:27:16 +01:00
parent 694671bc9a
commit d80fe5d4bc

View File

@ -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;
}