diff mbox series

[FFmpeg-devel,1/4] avcodec/loco: Fix integer overflow with large values from loco_get_rice()

Message ID 20200630202832.3672-1-michael@niedermayer.cc
State Accepted
Commit 3ddc5e1f3cebca25ade54ee68159d305f210bf5f
Headers show
Series [FFmpeg-devel,1/4] avcodec/loco: Fix integer overflow with large values from loco_get_rice()
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Michael Niedermayer June 30, 2020, 8:28 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer July 7, 2020, 4:22 p.m. UTC | #1
On Tue, Jun 30, 2020 at 10:28:29PM +0200, Michael Niedermayer wrote:
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index d0cedf577d..25dd1575ba 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -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;