summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-18 15:06:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-11-03 23:29:52 +0100
commit626094b9d34edb2d83cb6ba17fcb10083e0be55c (patch)
treefc5eb0dcb2ad48a2c9968b382c1010f593a267c9 /libavformat/rmdec.c
parentcdf35ba1d12bd86dc3e66af3c46e82451df5d96e (diff)
downloadffmpeg-626094b9d34edb2d83cb6ba17fcb10083e0be55c.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>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index b0a38bee83..dbbc5d5466 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -564,6 +564,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(;;) {