Skip to content
Snippets Groups Projects
Commit 459f2b39 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

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: default avatarMartin Storsjö <martin@martin.st>
parent 0d61f260
No related branches found
No related tags found
No related merge requests found
...@@ -145,6 +145,10 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) ...@@ -145,6 +145,10 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
av_log(s, AV_LOG_ERROR, "No seek table at given position\n"); av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
return; 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))) if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
return; return;
avio_read(s->pb, buf, size); avio_read(s->pb, buf, size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment