aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-19 23:17:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:46 +0100
commit268dfc0dd52ea524235f144b4be8ba4087092b90 (patch)
treed620b240434d5832c5d65de30d2c33aebdb73597 /libavcodec/alsdec.c
parent1157ba81cf4e6caf24a7408542d70d97b2dd1d41 (diff)
downloadffmpeg-268dfc0dd52ea524235f144b4be8ba4087092b90.tar.gz
avcodec/alsdec: Fix undefined behavior in decode_rice()
Fixes: left shift of 72 by 26 places cannot be represented in type 'int' Fixes: 15279/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5700665621348352 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 51f6870c37cc29e1ea7e0c66df2fe505938b7561) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 2660747472..e54440910c 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -487,7 +487,7 @@ static void parse_bs_info(const uint32_t bs_info, unsigned int n,
static int32_t decode_rice(GetBitContext *gb, unsigned int k)
{
int max = get_bits_left(gb) - k;
- int q = get_unary(gb, 0, max);
+ unsigned q = get_unary(gb, 0, max);
int r = k ? get_bits1(gb) : !(q & 1);
if (k > 1) {