Browse Source

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

fixes issue2480

Signed-off-by: Anton Khirnov <anton@khirnov.net>
tags/n0.8
Kostya Shishkov Anton Khirnov 14 years ago
parent
commit
29a290439b
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/ape.c

+ 5
- 0
libavformat/ape.c View File

@@ -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);
return AVERROR_INVALIDDATA;
}
ape->frames = av_malloc(ape->totalframes * sizeof(APEFrame));
if(!ape->frames)
return AVERROR(ENOMEM);


Loading…
Cancel
Save