]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/loco: Fix integer overflow with large values from loco_get_rice()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 30 Jun 2020 19:11:25 +0000 (21:11 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 7 Jul 2020 16:20:34 +0000 (18:20 +0200)
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>
libavcodec/loco.c

index d0cedf577dc306c544dbb44c634244778cd65e7b..25dd1575bac994604cf11be4e424157be550924b 100644 (file)
@@ -131,7 +131,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
                              int stride, const uint8_t *buf, int buf_size)
 {
     RICEContext rc;
-    int val;
+    unsigned val;
     int ret;
     int i, j;