mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-13 18:55:08 +00:00
truemotion1: Check input buffer size against header size.
Fixes overread. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a3f5ee297a
commit
e7b43e8e84
@ -314,7 +314,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
|
||||
const uint8_t *sel_vector_table;
|
||||
|
||||
header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
|
||||
if (s->buf[0] < 0x10)
|
||||
if (s->buf[0] < 0x10 || header.header_size >= s->size)
|
||||
{
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user