ffmpeg | branch: master | Michael Niedermayer <[email protected]> | Mon Feb 9 09:27:16 2015 +0100| [d80fe5d4bce3503390513ab7b7dbc634cacade40] | committer: Michael Niedermayer
avcodec/vb: Check for av_mallocz() failure Signed-off-by: Michael Niedermayer <[email protected]> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d80fe5d4bce3503390513ab7b7dbc634cacade40 --- libavcodec/vb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 3c89a29..41ee42e 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; } _______________________________________________ ffmpeg-cvslog mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
