[FFmpeg-cvslog] v210enc: check for coded_frame allocation failure

Paul B Mahol git at videolan.org
Tue Feb 7 02:02:58 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Feb  5 21:14:34 2012 +0000| [d73466f841b1732e4e817bf51f2153c4bab00428] | committer: Anton Khirnov

v210enc: check for coded_frame allocation failure

Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d73466f841b1732e4e817bf51f2153c4bab00428
---

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

diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 5861352..069f915 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -41,6 +41,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
                avctx->bits_per_raw_sample);
 
     avctx->coded_frame = avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     avctx->coded_frame->key_frame = 1;
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;



More information about the ffmpeg-cvslog mailing list