summaryrefslogtreecommitdiff
path: root/libavcodec/v210enc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-02-05 21:14:34 +0000
committerAnton Khirnov <anton@khirnov.net>2012-02-06 07:59:16 +0100
commitd73466f841b1732e4e817bf51f2153c4bab00428 (patch)
tree32ce526e8800b3e18ecf48c13b2375fd5fb6d0d8 /libavcodec/v210enc.c
parente496c45d9ba58586b3826c0bd9e4be155b8fd1df (diff)
v210enc: check for coded_frame allocation failure
Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/v210enc.c')
-rw-r--r--libavcodec/v210enc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 58613520a5..069f915158 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;