diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-18 15:06:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-26 16:51:02 +0200 |
commit | f24aa3a531d6aabd2a333830d8e4d448f18c1ddf (patch) | |
tree | 27f250abeb669f662f3c54500f493c7c3e68661c | |
parent | d3c80525b0433bf3fd63d60038a903ba91b62f93 (diff) | |
download | ffmpeg-f24aa3a531d6aabd2a333830d8e4d448f18c1ddf.tar.gz |
avformat/rmdec: check tag_size
Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6598073725353984
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2cb7ee8a36bddd3425897135db514ca62fec6e44)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/rmdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index b0aced5db9..acfabeef25 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -565,6 +565,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(;;) { |