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

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


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

r210dec: 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=1e90450fad76427d781f0ee44d8ee41037a395d1
---

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

diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c
index d310332..d8cad35 100644
--- a/libavcodec/r210dec.c
+++ b/libavcodec/r210dec.c
@@ -29,6 +29,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     avctx->bits_per_raw_sample = 10;
 
     avctx->coded_frame         = avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list