diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-09 09:27:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-09 09:27:16 +0100 |
commit | d80fe5d4bce3503390513ab7b7dbc634cacade40 (patch) | |
tree | 0428f8de58cdfa09de7cf8400416718512dfdada /libavcodec/vb.c | |
parent | 694671bc9af5117bfb6a8bdd19821592f0d9372d (diff) | |
download | ffmpeg-d80fe5d4bce3503390513ab7b7dbc634cacade40.tar.gz |
avcodec/vb: Check for av_mallocz() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vb.c')
-rw-r--r-- | libavcodec/vb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 3c89a2986e..41ee42eca5 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; } |