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

Paul B Mahol onemda at gmail.com
Sat Jan 28 21:27:35 CET 2012


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/v210x.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c
index ec74a33..1435249 100644
--- a/libavcodec/v210x.c
+++ b/libavcodec/v210x.c
@@ -31,6 +31,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