avidec: Check that the header chunks fit in the available filesize.

Fixes Ticket771
Bug found by: Diana Elena Muscalu

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-16 06:13:04 +01:00
parent f72601d063
commit 62adc60b97

View File

@ -387,6 +387,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
tag = avio_rl32(pb);
size = avio_rl32(pb);
if(size > avi->fsize){
av_log(s, AV_LOG_ERROR, "chunk size is too big during header parsing\n");
goto fail;
}
print_tag("tag", tag, size);
switch(tag) {