aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-01 22:52:13 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit51e0e2deafa391b7a053293eb94cd37cf00237a6 (patch)
tree9cb5f2fafcf6d049533ec3491620c66afb3991f1
parentdad6714ce67a35bdbcfce0d23a1d0f1edea766f0 (diff)
downloadffmpeg-51e0e2deafa391b7a053293eb94cd37cf00237a6.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.c10
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;