[FFmpeg-cvslog] ac3enc: check return value of avcodec_alloc_frame()

Paul B Mahol git at videolan.org
Sat Jan 28 21:49:15 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jan 28 19:04:35 2012 +0000| [88fb935c1cb95c6e0e41b0b3ede2f87c60782a7c] | committer: Michael Niedermayer

ac3enc: check return value of avcodec_alloc_frame()

Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88fb935c1cb95c6e0e41b0b3ede2f87c60782a7c
---

 libavcodec/ac3enc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 93a0882..2f1e7c8 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);



More information about the ffmpeg-cvslog mailing list