summaryrefslogtreecommitdiff
path: root/libavformat/sierravmd.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-09-11 09:59:40 +0000
committerPaul B Mahol <onemda@gmail.com>2013-09-11 11:06:44 +0000
commit60caa3d8bc11677b90b791398ac7cca68a7389be (patch)
tree6dae50c2629c0e11dee59f9a244ab3a231660518 /libavformat/sierravmd.c
parent00e1bf8a587e26029f8fb20a35c65b99fe14196b (diff)
downloadffmpeg-60caa3d8bc11677b90b791398ac7cca68a7389be.tar.gz
avformat/sierravmd: check for memory allocation failures
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/sierravmd.c')
-rw-r--r--libavformat/sierravmd.c4
1 files changed, 3 insertions, 1 deletions
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);
}