summaryrefslogtreecommitdiff
path: root/libavcodec/asvenc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-05-31 14:50:21 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-05-31 15:03:30 +0200
commite524f37356156893cae50fc46451bd4a6198703d (patch)
treef7783e7c37804f9541b1876c372442ba00cae0c5 /libavcodec/asvenc.c
parent074a1b37325bf6d1483fc23ebf1255e78d998339 (diff)
asv: Check memory allocation
Diffstat (limited to 'libavcodec/asvenc.c')
-rw-r--r--libavcodec/asvenc.c2
1 files changed, 2 insertions, 0 deletions
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"));