diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-03 14:57:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-03 14:58:55 +0200 |
commit | 50fd98b7ac4c410f4413d382eecb415011b37920 (patch) | |
tree | 8e3048148be9293056016a6d8ad7c18508619451 | |
parent | bdb4ed963f7ecf919075838a64904fd6e49d07ba (diff) | |
parent | 488b2984fece7ad0c2596826fee18e74aa904667 (diff) | |
download | ffmpeg-50fd98b7ac4c410f4413d382eecb415011b37920.tar.gz |
Merge commit '488b2984fece7ad0c2596826fee18e74aa904667'
* commit '488b2984fece7ad0c2596826fee18e74aa904667':
ape demuxer: check for EOF in potentially long loops
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/ape.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c index bb61a2498d..6a78ea9908 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -281,13 +281,13 @@ static int ape_read_header(AVFormatContext * s) ape->seektable = av_malloc(ape->seektablelength); if (!ape->seektable) return AVERROR(ENOMEM); - for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++) + for (i = 0; i < ape->seektablelength / sizeof(uint32_t) && !pb->eof_reached; i++) ape->seektable[i] = avio_rl32(pb); if (ape->fileversion < 3810) { ape->bittable = av_malloc(ape->totalframes); if (!ape->bittable) return AVERROR(ENOMEM); - for (i = 0; i < ape->totalframes; i++) + for (i = 0; i < ape->totalframes && !pb->eof_reached; i++) ape->bittable[i] = avio_r8(pb); } }else{ |