]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/loco: Fix signed integer overflow in loco_get_rice()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 9 Jun 2020 20:14:59 +0000 (22:14 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 Jun 2020 22:43:09 +0000 (00:43 +0200)
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 22975/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5658160970072064
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 e891d83ece94f62892530d2da19048440f233cb3..d0cedf577dc306c544dbb44c634244778cd65e7b 100644 (file)
@@ -82,7 +82,7 @@ static inline void loco_update_rice_param(RICEContext *r, int val)
 
 static inline int loco_get_rice(RICEContext *r)
 {
-    int v;
+    unsigned v;
     if (r->run > 0) { /* we have zero run */
         r->run--;
         loco_update_rice_param(r, 0);