[FFmpeg-cvslog] ape: stop reading after the last frame has been read

Justin Ruggles git at videolan.org
Tue Feb 7 02:03:00 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sat Feb  4 16:34:20 2012 -0500| [c2c316158fb670f61abfa108cb940ba31264b0f8] | committer: Justin Ruggles

ape: stop reading after the last frame has been read

This avoids buffer overread when the last packet size estimate is too small.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2c316158fb670f61abfa108cb940ba31264b0f8
---

 libavformat/ape.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index 853fdca..c650a54 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)



More information about the ffmpeg-cvslog mailing list