ape: Fix null ptr dereference with files missing a seekatable.

Such files are currently not supported as the table is used at several points

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e7cb161515)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-05-29 19:50:15 +02:00
parent ee6c1670df
commit b3e5c8de6a

View File

@ -274,6 +274,9 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
return AVERROR(ENOMEM);
for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
ape->seektable[i] = avio_rl32(pb);
}else{
av_log(s, AV_LOG_ERROR, "Missing seektable\n");
return -1;
}
ape->frames[0].pos = ape->firstframe;