From: Vittorio Giovara Date: Fri, 24 Jul 2015 03:24:33 +0000 (+0100) Subject: wmv2enc: Check memory allocation X-Git-Tag: android-x86-7.1-r1~252^2~2171 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=03eb55741427c6608f63972c105e565ca0ba4f15;p=android-x86%2Fexternal-ffmpeg.git wmv2enc: Check memory allocation --- diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index e4e51d32f9..e4d4159e37 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -63,6 +63,9 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx) avctx->extradata_size = 4; avctx->extradata = av_mallocz(avctx->extradata_size + 10); + if (!avctx->extradata) + return AVERROR(ENOMEM); + encode_ext_header(w); return 0;