aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-02-04 16:34:20 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-02-06 13:09:11 -0500
commitc2c316158fb670f61abfa108cb940ba31264b0f8 (patch)
tree6dc96796ba6649fd0969eafe2a06f1f93f5115b3 /libavformat
parent66f7be3603b527153daaae0999c743eb1438c7e5 (diff)
downloadffmpeg-c2c316158fb670f61abfa108cb940ba31264b0f8.tar.gz
ape: stop reading after the last frame has been read
This avoids buffer overread when the last packet size estimate is too small.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/ape.c2
1 files changed, 1 insertions, 1 deletions
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)