aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-30 21:11:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:19 +0200
commit0b8425dc76c00dbc5d47a13e274e11e9308c6806 (patch)
treea3544d6ef51149611be7b02075ccb814a0d8621e
parent7f96fc8c1376bbaf388ff07ecebe16aebda92157 (diff)
downloadffmpeg-0b8425dc76c00dbc5d47a13e274e11e9308c6806.tar.gz
avcodec/loco: Fix integer overflow with large values from loco_get_rice()
Fixes: signed integer overflow: 155 + 2147483647 cannot be represented in type 'int' Fixes: 23421/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5652849097965568 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 3ddc5e1f3cebca25ade54ee68159d305f210bf5f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/loco.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index e22d280b96..f9655c0bf5 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -129,7 +129,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
int stride, const uint8_t *buf, int buf_size, int step)
{
RICEContext rc;
- int val;
+ unsigned val;
int ret;
int i, j;