aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-03-26 02:30:57 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-03-26 23:19:49 +0100
commitd188a867302fd745b5980a90a0b5cad9016c477c (patch)
tree9f9c4b64dd67f6fd6a669f8cb6749a41bd1fa302 /libavcodec
parent7eabe564365f4130c4d8f1d50fd835b45dc46355 (diff)
downloadffmpeg-d188a867302fd745b5980a90a0b5cad9016c477c.tar.gz
avcodec/rtv1: fix undefined FFALIGN
Fixes: signed integer overflow: 2147483647 + 4 cannot be represented in type 'int' Fixes: 62285/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RTV1_fuzzer-6324303861514240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/rtv1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/rtv1.c b/libavcodec/rtv1.c
index 06afe9e873..807c8a3466 100644
--- a/libavcodec/rtv1.c
+++ b/libavcodec/rtv1.c
@@ -113,6 +113,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
width = bytestream2_get_le32(&gb);
height = bytestream2_get_le32(&gb);
+ if (width > INT_MAX-4U || height > INT_MAX-4U)
+ return AVERROR_INVALIDDATA;
ret = ff_set_dimensions(avctx, FFALIGN(width, 4), FFALIGN(height, 4));
if (ret < 0)
return ret;