Commit 6d1073ee authored by michael's avatar michael

verify len field validity in mjpeg_decode_com()


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4451 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 87c00419
......@@ -1728,10 +1728,8 @@ out:
static int mjpeg_decode_com(MJpegDecodeContext *s)
{
/* XXX: verify len field validity */
int len = get_bits(&s->gb, 16);
if (len >= 2 && len < 32768) {
/* XXX: any better upper bound */
if (len >= 2 && 8*len - 16 + get_bits_count(&s->gb) <= s->gb.size_in_bits) {
uint8_t *cbuf = av_malloc(len - 1);
if (cbuf) {
int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment