diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-08-24 23:30:46 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-09-02 21:28:55 +0400 |
commit | 488b2984fece7ad0c2596826fee18e74aa904667 (patch) | |
tree | a7d2ef5994d2dfe766f2d6205b4996ba56231aff /libavformat/ape.c | |
parent | a7c1689dedd11689edb30088d467ac03f9b8d1cf (diff) |
ape demuxer: check for EOF in potentially long loops
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Diffstat (limited to 'libavformat/ape.c')
-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 c4ce6acf80..4079947439 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -283,13 +283,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); } } |