From 60caa3d8bc11677b90b791398ac7cca68a7389be Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 11 Sep 2013 09:59:40 +0000 Subject: [PATCH] avformat/sierravmd: check for memory allocation failures Signed-off-by: Paul B Mahol --- libavformat/sierravmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index b2d1e5dd59..059945dc0f 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -126,8 +126,10 @@ static int vmd_read_header(AVFormatContext *s) vst->codec->width >>= 1; vst->codec->height >>= 1; } - vst->codec->extradata_size = VMD_HEADER_SIZE; vst->codec->extradata = av_mallocz(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); + if (!vst->codec->extradata) + return AVERROR(ENOMEM); + vst->codec->extradata_size = VMD_HEADER_SIZE; memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE); }