diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 7b9097e7ec..fc686966e5 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -566,6 +566,8 @@ static int rm_read_header(AVFormatContext *s) } tag_size = avio_rb32(pb); + if (tag_size < 0) + return AVERROR_INVALIDDATA; avio_skip(pb, tag_size - 8); for(;;) {