avcodec/vb: Check for av_mallocz() failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/111/head
Michael Niedermayer 10 years ago
parent 694671bc9a
commit d80fe5d4bc
  1. 6
      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;
}

Loading…
Cancel
Save