mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 02:04:58 +00:00
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>
(cherry picked from commit 124eb202e7
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
4ff1fcd3ca
commit
6bd562e044
@ -1223,8 +1223,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);
|
||||
|
Loading…
Reference in New Issue
Block a user