aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/sierravmd.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-14 17:15:18 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-14 17:15:18 +0000
commit21ab5c58270271dbebc061015187bca02e5d51ce (patch)
treec1ac39dd448069a43797c3b0a0484e49c1cc5cd0 /libavformat/sierravmd.c
parent65d6d40350e7ccf693c058fddf183f9e90e0e511 (diff)
downloadffmpeg-21ab5c58270271dbebc061015187bca02e5d51ce.tar.gz
Extend check for integer overflow for malloc argument to take into account
also the addition of "sound_buffers" not only the multiplication. Originally committed as revision 19840 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/sierravmd.c')
-rw-r--r--libavformat/sierravmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 52f05826d5..5aa5a04dbb 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -154,7 +154,7 @@ static int vmd_read_header(AVFormatContext *s,
vmd->frame_table = NULL;
sound_buffers = AV_RL16(&vmd->vmd_header[808]);
raw_frame_table_size = vmd->frame_count * 6;
- if(vmd->frame_count * vmd->frames_per_block >= UINT_MAX / sizeof(vmd_frame)){
+ if(vmd->frame_count * vmd->frames_per_block >= (UINT_MAX - sound_buffers) / sizeof(vmd_frame)){
av_log(s, AV_LOG_ERROR, "vmd->frame_count * vmd->frames_per_block too large\n");
return -1;
}