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

Paul B Mahol onemda at gmail.com
Sat Jan 28 21:09:05 CET 2012


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 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;
 }
-- 
1.7.7



More information about the ffmpeg-devel mailing list