diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-18 15:06:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-28 21:04:04 +0200 |
commit | 62dfe4f4110f0a956d0fede7beae08d79167bdd5 (patch) | |
tree | d0848253155af46e5a1a81330ec64883751b68fd | |
parent | 7280495991b0b66a3d82d41a8862e232b4629d4e (diff) | |
download | ffmpeg-62dfe4f4110f0a956d0fede7beae08d79167bdd5.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 5802f0ff01..8bd8b030a5 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -518,6 +518,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(;;) { |