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

Paul B Mahol git at videolan.org
Sat Jan 28 22:24:30 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jan 28 20:01:09 2012 +0000| [766e160e87c3c1997559b8225a635b68a06167fc] | committer: Michael Niedermayer

libopencore-amr: 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=766e160e87c3c1997559b8225a635b68a06167fc
---

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

diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index 0de7130..d4853ca 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -196,6 +196,8 @@ static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
 
     avctx->frame_size  = 160;
     avctx->coded_frame = avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     s->enc_state = Encoder_Interface_init(s->enc_dtx);
     if (!s->enc_state) {



More information about the ffmpeg-cvslog mailing list