diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-08-24 21:30:46 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-09-07 10:18:18 +0200 |
commit | 9486e98712879e1f3b2d83bbfc361e402b535005 (patch) | |
tree | 1d9a0f47e29651cbca65ea9d55aef0ce30cab974 | |
parent | f3c7e604fabd1505c7de3eaddee5a24b8aacf4c3 (diff) | |
download | ffmpeg-9486e98712879e1f3b2d83bbfc361e402b535005.tar.gz |
ape demuxer: check for EOF in potentially long loops
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry-picked from commit 488b2984fece7ad0c2596826fee18e74aa904667)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavformat/ape.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c index d67e684167..a9c695efe0 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -276,7 +276,9 @@ 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); } |