From 88fb935c1cb95c6e0e41b0b3ede2f87c60782a7c Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 28 Jan 2012 19:04:35 +0000 Subject: ac3enc: check return value of avcodec_alloc_frame() Signed-off-by: Paul B Mahol Signed-off-by: Michael Niedermayer --- libavcodec/ac3enc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/ac3enc.c') diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 93a08821be..2f1e7c8f67 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -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); -- cgit v1.2.3