Skip to content

Commit 7f9ec55

Browse files
孙浩 and 张洪亮(望初)michaelni
孙浩 and 张洪亮(望初)
authored andcommitted
avformat/asfdec: Fix DoS due to lack of eof check
Fixes: loop.asf Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 7ec4148 commit 7f9ec55

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: libavformat/asfdec_f.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -749,13 +749,15 @@ static int asf_read_marker(AVFormatContext *s, int64_t size)
749749
count = avio_rl32(pb); // markers count
750750
avio_rl16(pb); // reserved 2 bytes
751751
name_len = avio_rl16(pb); // name length
752-
for (i = 0; i < name_len; i++)
753-
avio_r8(pb); // skip the name
752+
avio_skip(pb, name_len);
754753

755754
for (i = 0; i < count; i++) {
756755
int64_t pres_time;
757756
int name_len;
758757

758+
if (avio_feof(pb))
759+
return AVERROR_INVALIDDATA;
760+
759761
avio_rl64(pb); // offset, 8 bytes
760762
pres_time = avio_rl64(pb); // presentation time
761763
pres_time -= asf->hdr.preroll * 10000;

0 commit comments

Comments
 (0)