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 488b2984fe
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:

committed by
Sean McGovern

parent
8d2a86a290
commit
23f73fc241
@@ -276,7 +276,9 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
|
|||||||
ape->seektable = av_malloc(ape->seektablelength);
|
ape->seektable = av_malloc(ape->seektablelength);
|
||||||
if (!ape->seektable)
|
if (!ape->seektable)
|
||||||
return AVERROR(ENOMEM);
|
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);
|
ape->seektable[i] = avio_rl32(pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user