Skip to content

Commit 124eb20

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: libavformat/rmdec.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,11 @@ static int ivr_read_header(AVFormatContext *s)
12231223
av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val);
12241224
} else if (type == 4) {
12251225
av_log(s, AV_LOG_DEBUG, "%s = '0x", key);
1226-
for (j = 0; j < len; j++)
1226+
for (j = 0; j < len; j++) {
1227+
if (avio_feof(pb))
1228+
return AVERROR_INVALIDDATA;
12271229
av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb));
1230+
}
12281231
av_log(s, AV_LOG_DEBUG, "'\n");
12291232
} else if (len == 4 && type == 3 && !strncmp(key, "StreamCount", tlen)) {
12301233
nb_streams = value = avio_rb32(pb);

0 commit comments

Comments
 (0)