ac3enc: check return value of avcodec_alloc_frame()
authorPaul B Mahol <onemda@gmail.com>
Sat, 28 Jan 2012 19:04:35 +0000 (19:04 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Jan 2012 19:13:38 +0000 (20:13 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ac3enc.c

index 93a0882..2f1e7c8 100644 (file)
@@ -2466,6 +2466,8 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
         goto init_fail;
 
     avctx->coded_frame= avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        goto init_fail;
 
     dsputil_init(&s->dsp, avctx);
     ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);