mpc8: Check the seek table size parsed from the bitstream
Limit the size to INT_MAX/2 (for simplicity) to be sure that size + FF_INPUT_BUFFER_PADDING_SIZE won't overflow. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit459f2b393a) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commitf8a72f041c)
This commit is contained in:
parent
b81d804f2a
commit
486c457675
1 changed files with 4 additions and 0 deletions
|
|
@ -143,6 +143,10 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
|
|||
av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
|
||||
return;
|
||||
}
|
||||
if (size < 0 || size >= INT_MAX / 2) {
|
||||
av_log(s, AV_LOG_ERROR, "Bad seek table size\n");
|
||||
return;
|
||||
}
|
||||
if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
|
||||
return;
|
||||
avio_read(s->pb, buf, size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue