diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-01 22:52:13 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-19 17:17:36 +0200 |
commit | ddcbb66e0048cec0685ec8f92fdee4d7fd0e1533 (patch) | |
tree | 6a29d02af83201dff93829a445576b7c1c3d1ca1 | |
parent | 85b921c4dcf27046945c7c80cbab0986c1631ec8 (diff) | |
download | ffmpeg-ddcbb66e0048cec0685ec8f92fdee4d7fd0e1533.tar.gz |
avcodec/flacdsp_template: Fix invalid shifts in decorrelate
Fixes: left shift of negative value -2
Fixes: 20303/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5096829297623040
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 3935c891e96c0819439da43d1b862652bbbdf065)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/flacdsp_template.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/flacdsp_template.c b/libavcodec/flacdsp_template.c index 776c78da71..892418cddc 100644 --- a/libavcodec/flacdsp_template.c +++ b/libavcodec/flacdsp_template.c @@ -66,8 +66,8 @@ static void FUNC(flac_decorrelate_ls_c)(uint8_t **out, int32_t **in, int i; for (i = 0; i < len; i++) { - int a = in[0][i]; - int b = in[1][i]; + unsigned a = in[0][i]; + unsigned b = in[1][i]; S(samples, 0, i) = a << shift; S(samples, 1, i) = (a - b) << shift; } @@ -80,8 +80,8 @@ static void FUNC(flac_decorrelate_rs_c)(uint8_t **out, int32_t **in, int i; for (i = 0; i < len; i++) { - int a = in[0][i]; - int b = in[1][i]; + unsigned a = in[0][i]; + unsigned b = in[1][i]; S(samples, 0, i) = (a + b) << shift; S(samples, 1, i) = b << shift; } @@ -94,7 +94,7 @@ static void FUNC(flac_decorrelate_ms_c)(uint8_t **out, int32_t **in, int i; for (i = 0; i < len; i++) { - int a = in[0][i]; + unsigned a = in[0][i]; int b = in[1][i]; a -= b >> 1; S(samples, 0, i) = (a + b) << shift; |