mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-13 21:26:33 +02:00
3rd 10l - don't let it read data beyond the end of frame
Originally committed as revision 1083 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
9d3748bed3
commit
055317a74c
@ -1283,7 +1283,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
while (src<buf_end)
|
while (src<buf_end)
|
||||||
{
|
{
|
||||||
unsigned char x = *(src++);
|
UINT8 x = *(src++);
|
||||||
|
|
||||||
*(dst++) = x;
|
*(dst++) = x;
|
||||||
if (x == 0xff)
|
if (x == 0xff)
|
||||||
@ -1295,7 +1295,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
init_get_bits(&s->gb, s->buffer, s->buffer_size);
|
init_get_bits(&s->gb, s->buffer, dst - s->buffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
init_get_bits(&s->gb, buf_ptr, buf_end - buf_ptr);
|
init_get_bits(&s->gb, buf_ptr, buf_end - buf_ptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user