Commit 770482de authored by 孙浩 and 张洪亮(望初)'s avatar 孙浩 and 张洪亮(望初) Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 124eb202)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 64aa8bb8
......@@ -1235,8 +1235,11 @@ static int ivr_read_header(AVFormatContext *s)
av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val);
} else if (type == 4) {
av_log(s, AV_LOG_DEBUG, "%s = '0x", key);
for (j = 0; j < len; j++)
for (j = 0; j < len; j++) {
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb));
}
av_log(s, AV_LOG_DEBUG, "'\n");
} else if (len == 4 && type == 3 && !strncmp(key, "StreamCount", tlen)) {
nb_streams = value = avio_rb32(pb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment