]> git.sesse.net Git - ffmpeg/commitdiff
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 1b038b11c9003f252f3cea20a77d89715ad346ac..3299cc614013228cf980a0f5f6af7cbcb27f60ab 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;