ffv1: check for malloc failure.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 11 May 2013 19:23:46 +0000 (21:23 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 11 May 2013 19:23:46 +0000 (21:23 +0200)
Somehow i managed to loose this fix before pushing

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ffv1.c

index 1b038b1..3299cc6 100644 (file)
@@ -51,6 +51,8 @@ av_cold int ffv1_common_init(AVCodecContext *avctx)
 
     s->picture.f = avcodec_alloc_frame();
     s->last_picture.f = av_frame_alloc();
+    if (!s->picture.f || !s->last_picture.f)
+        return AVERROR(ENOMEM);
     ff_dsputil_init(&s->dsp, avctx);
 
     s->width  = avctx->width;