mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-07 16:40:10 +02:00
pmpdec: check for EOF while reading index.
Otherwise even a tiny file can trigger a huge memory allocation. Related to ticket #2298. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
82d79289db
commit
50a37f9202
@ -105,6 +105,10 @@ static int pmp_header(AVFormatContext *s)
|
||||
for (i = 0; i < index_cnt; i++) {
|
||||
int size = avio_rl32(pb);
|
||||
int flags = size & 1 ? AVINDEX_KEYFRAME : 0;
|
||||
if (url_feof(pb)) {
|
||||
av_log(s, AV_LOG_FATAL, "Encountered EOF while reading index.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
size >>= 1;
|
||||
av_add_index_entry(vst, pos, i, size, 0, flags);
|
||||
pos += size;
|
||||
|
Loading…
Reference in New Issue
Block a user