提交 21ab5c58 编写于 作者: R Reimar Döffinger

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
上级 65d6d403
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册