summaryrefslogtreecommitdiff
path: root/libavformat/ape.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2011-04-01 09:26:38 +0200
committerAnton Khirnov <anton@khirnov.net>2011-04-01 09:34:44 +0200
commit29a290439ba28fde00b2a27d5afef863c63abb37 (patch)
tree4000795eade372a5603176ec5338287e41cabc16 /libavformat/ape.c
parente006d71fa849542eb27146efac629288703b3d75 (diff)
downloadffmpeg-29a290439ba28fde00b2a27d5afef863c63abb37.tar.gz
ape: check that number of seektable entries is equal to number of frames
fixes issue2480 Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/ape.c')
-rw-r--r--libavformat/ape.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 6c8880d2c0..5aac00c56a 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -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);