mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avformat/mvdec: Fix DoS due to lack of eof check
Fixes: loop.mv
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f05e2e2dc
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1720050ae6
commit
6b004e23d7
@ -338,6 +338,8 @@ static int mv_read_header(AVFormatContext *avctx)
|
||||
uint32_t pos = avio_rb32(pb);
|
||||
uint32_t asize = avio_rb32(pb);
|
||||
uint32_t vsize = avio_rb32(pb);
|
||||
if (avio_feof(pb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
avio_skip(pb, 8);
|
||||
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
|
||||
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
|
||||
|
Loading…
Reference in New Issue
Block a user