summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-09 09:27:16 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-09 09:27:16 +0100
commitd80fe5d4bce3503390513ab7b7dbc634cacade40 (patch)
tree0428f8de58cdfa09de7cf8400416718512dfdada
parent694671bc9af5117bfb6a8bdd19821592f0d9372d (diff)
avcodec/vb: Check for av_mallocz() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vb.c6
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;
}