ape: stop reading after the last frame has been read

This avoids buffer overread when the last packet size estimate is too small.
This commit is contained in:
Justin Ruggles 2012-02-04 16:34:20 -05:00
parent 66f7be3603
commit c2c316158f
1 changed files with 1 additions and 1 deletions

View File

@ -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)