Commit 29a29043 authored by Kostya Shishkov's avatar Kostya Shishkov Committed by Anton Khirnov

ape: check that number of seektable entries is equal to number of frames

fixes issue2480
Signed-off-by: default avatarAnton Khirnov <>
parent e006d71f
......@@ -250,6 +250,11 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
av_log(s, AV_LOG_ERROR, "Too many frames: %d\n", ape->totalframes);
return -1;
if (ape->seektablelength && (ape->seektablelength / sizeof(*ape->seektable)) < ape->totalframes) {
av_log(s, AV_LOG_ERROR, "Number of seek entries is less than number of frames: %d vs. %d\n",
ape->seektablelength / sizeof(*ape->seektable), ape->totalframes);
ape->frames = av_malloc(ape->totalframes * sizeof(APEFrame));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment