Commit 80fd348b authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/rmdec: Check size in ivr_read_packet() before use

Fixes out of array access
Fixes: asan_heap-oob_445b39_1741_d00eb645ab48eb2203b4a04a5b997103.ivr

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent fc2588a1
......@@ -1357,6 +1357,11 @@ static int ivr_read_packet(AVFormatContext *s, AVPacket *pkt)
size = avio_rb32(pb);
avio_skip(pb, 4);
if (size < 1 || size > INT_MAX/4) {
av_log(s, AV_LOG_ERROR, "size %d is invalid\n");
return AVERROR_INVALIDDATA;
}
st = s->streams[index];
ret = ff_rm_parse_packet(s, pb, st, st->priv_data, size, pkt,
&seq, 0, pts);
......
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