mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-02-16 09:58:19 +00:00
avcodec/vb: Check for av_mallocz() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
694671bc9a
commit
d80fe5d4bc
@ -251,6 +251,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
c->frame = av_mallocz(avctx->width * avctx->height);
|
c->frame = av_mallocz(avctx->width * avctx->height);
|
||||||
c->prev_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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user