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

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


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jan 28 19:06:44 2012 +0000| [7b21b0f155fffa1af52e48f187415e3d58bdbae1] | committer: Michael Niedermayer

adxenc: 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=7b21b0f155fffa1af52e48f187415e3d58bdbae1
---

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

diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c
index b029e2e..c6e4656 100644
--- a/libavcodec/adxenc.c
+++ b/libavcodec/adxenc.c
@@ -120,6 +120,8 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
     avctx->frame_size = BLOCK_SAMPLES;
 
     avctx->coded_frame = avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     /* the cutoff can be adjusted, but this seems to work pretty well */
     c->cutoff = 500;



More information about the ffmpeg-cvslog mailing list