Commit 2d2d31c2 authored by michael's avatar michael

check len (should fix #1165694)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4436 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1f5112b5
......@@ -1585,10 +1585,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
{
int len, id;
/* XXX: verify len field validity */
len = get_bits(&s->gb, 16);
if (len < 5)
return -1;
if(8*len + get_bits_count(&s->gb) > s->gb.size_in_bits)
return -1;
id = (get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16);
id = be2me_32(id);
......
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