mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
check len (should fix #1165694)
Originally committed as revision 4436 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
1a55810e87
commit
aa6ff39bb0
@ -1585,10 +1585,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
|||||||
{
|
{
|
||||||
int len, id;
|
int len, id;
|
||||||
|
|
||||||
/* XXX: verify len field validity */
|
|
||||||
len = get_bits(&s->gb, 16);
|
len = get_bits(&s->gb, 16);
|
||||||
if (len < 5)
|
if (len < 5)
|
||||||
return -1;
|
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 = (get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16);
|
||||||
id = be2me_32(id);
|
id = be2me_32(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user