X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvb.c;h=41ee42eca59f561ef2fba45a0e977c270253b210;hb=7a7b77e6c97aabb654414044a000e8c4e9d52575;hp=3c89a2986e3fa51d6b63f50eba3a0cf0cc47db92;hpb=4ce67c961c0ff25580c922b6b1906012b8bcb329;p=ffmpeg diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 3c89a2986e3..41ee42eca59 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -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; }