ape: stop reading after the last frame has been read

This avoids buffer overread when the last packet size estimate is too small.
pull/3/merge
Justin Ruggles 13 years ago
parent 66f7be3603
commit c2c316158f
  1. 2
      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)

Loading…
Cancel
Save