From c2c316158fb670f61abfa108cb940ba31264b0f8 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 4 Feb 2012 16:34:20 -0500 Subject: ape: stop reading after the last frame has been read This avoids buffer overread when the last packet size estimate is too small. --- libavformat/ape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/ape.c') diff --git a/libavformat/ape.c b/libavformat/ape.c index 853fdcac7e..c650a54ad4 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -358,7 +358,7 @@ static int ape_read_packet(AVFormatContext * s, AVPacket * pkt) if (s->pb->eof_reached) return AVERROR_EOF; - if (ape->currentframe > ape->totalframes) + if (ape->currentframe >= ape->totalframes) return AVERROR_EOF; if (avio_seek(s->pb, ape->frames[ape->currentframe].pos, SEEK_SET) < 0) -- cgit v1.2.3