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:
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->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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user