From e524f37356156893cae50fc46451bd4a6198703d Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Sun, 31 May 2015 14:50:21 +0200 Subject: asv: Check memory allocation --- libavcodec/asvenc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/asvenc.c') diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index f8c52af18b..08796150f1 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -299,6 +299,8 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->global_quality / 2) / avctx->global_quality; avctx->extradata = av_mallocz(8); + if (!avctx->extradata) + return AVERROR(ENOMEM); avctx->extradata_size = 8; ((uint32_t *) avctx->extradata)[0] = av_le2ne32(a->inv_qscale); ((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS")); -- cgit v1.2.3