]> git.sesse.net Git - ffmpeg/commitdiff
v210enc: check return value of avcodec_alloc_frame()
authorPaul B Mahol <onemda@gmail.com>
Sat, 28 Jan 2012 20:27:17 +0000 (20:27 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Jan 2012 21:08:21 +0000 (22:08 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/v210enc.c

index 1a78aa24757ed4e494f94446e1fe45bb971be733..bcfe0717c4fc1b29c81a90c72134eef9574a28ea 100644 (file)
@@ -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;