aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-16 11:26:57 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-14 23:30:37 +0100
commit9a7d3304ff40bc5c93f92aaa375d4177672b8b5e (patch)
treee36324c3d130b4d548ef7149c7c53087100c08d3
parent241f59eb8b4ab078a5d6642edd27b60019c03d8c (diff)
downloadffmpeg-9a7d3304ff40bc5c93f92aaa375d4177672b8b5e.tar.gz
avcodec/apedec: Add k < 24 check to the only k++ case which lacks such a check
Fixes: 15255/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5718831688843264 Fixes: left shift of 1 by 31 places cannot be represented in type 'int' 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 3d4f4f4a15e79c96c3613e5c252b2f5cc4190e18) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 15eb416ba4..eb31fd70c1 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -460,7 +460,7 @@ static inline void update_rice(APERice *rice, unsigned int x)
if (rice->ksum < lim)
rice->k--;
- else if (rice->ksum >= (1 << (rice->k + 5)))
+ else if (rice->ksum >= (1 << (rice->k + 5)) && rice->k < 24)
rice->k++;
}