]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vb.c
Merge commit '31dc73e92a96f08d07650c0e7d31c0b9a1465d46'
[ffmpeg] / libavcodec / vb.c
index 3c89a2986e3fa51d6b63f50eba3a0cf0cc47db92..41ee42eca59f561ef2fba45a0e977c270253b210 100644 (file)
@@ -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;
 }