mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-27 21:40:34 +00:00
avcodec/vp7: check buffer size
Fixes overread Fixes Ticket 3501 Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
067ada04d1
commit
46f72ea507
@ -434,6 +434,11 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
|
||||
s->invisible = 0;
|
||||
part1_size = AV_RL24(buf) >> 4;
|
||||
|
||||
if (buf_size < 4 - s->profile + part1_size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Buffer size %d is too small, needed : %d\n", buf_size, 4 - s->profile + part1_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
buf += 4 - s->profile;
|
||||
buf_size -= 4 - s->profile;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user