提交 36013037 编写于 作者: M Michael Niedermayer

fixing an integer overflow, which could lead to overwriting the end of a malloced buffer by 8 bytes

Originally committed as revision 3937 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 db2fcbbd
......@@ -212,7 +212,8 @@ static int vmd_read_header(AVFormatContext *s,
/* if the frame size is 0, do not count the frame and bring the
* total frame count down */
vmd->frame_table[i].frame_size = LE_32(&current_frame_record[2]);
// note, we limit the size to 1Gb to ensure that we dont end up overflowing the size integer used to allocate the memory
vmd->frame_table[i].frame_size = LE_32(&current_frame_record[2]) & 0x3FFFFFFF;
/* this logic is present so that 0-length audio chunks are not
* accounted */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册