提交 e4bc8af1 编写于 作者: B Baptiste Coudurier

check entries against field_size, potential malloc overflow in read_stsz, fix #1357

Originally committed as revision 19793 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 1c4bf2ec
......@@ -1256,7 +1256,7 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return -1;
}
if(entries >= UINT_MAX / sizeof(int))
if (entries >= UINT_MAX / sizeof(int) || entries >= (UINT_MAX - 4) / field_size)
return -1;
sc->sample_sizes = av_malloc(entries * sizeof(int));
if (!sc->sample_sizes)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册