diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-08-24 21:30:46 +0200 |
---|---|---|
committer | Sean McGovern <gseanmcg@gmail.com> | 2013-09-23 19:48:52 -0400 |
commit | 23f73fc241da56ba00b76f975bff56d85c8caa58 (patch) | |
tree | c6c153feadada4b78bc30c3bd1f296f0009fd3b5 | |
parent | 8d2a86a29055d375eed9c1e93983f42c42fe856d (diff) | |
download | ffmpeg-23f73fc241da56ba00b76f975bff56d85c8caa58.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 a60626e133..7d4cd39568 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -276,7 +276,9 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) 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); } |