From da06f6a311095df0b980c62bac40ce73b45b02a0 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 28 Apr 2016 21:57:13 +0200 Subject: [PATCH 1/1] wmadec: Fix left shift of negative value. gcc-6.1 complains about this: wmadec_filter.c:819:33: warning: left shift of negative value [-Wshift-negative-value] mult1 = mult * exponents[((-1 << bsize)) >> esize]; The new code still looks wrong because we now shift a negative value to the right. Moreover, it is not clear that the resulting value is within array bounds. On the other hand, ffmpeg has the same fix (commit a48b24e5 in the ffmpeg repository), so.. --- wmadec_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmadec_filter.c b/wmadec_filter.c index be638ced..0dff2b79 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -810,7 +810,7 @@ static void compute_mdct_coefficients(struct private_wmadec_data *pwd, } /* very high freqs: noise */ n = pwd->block_len - pwd->coefs_end[bsize]; - mult1 = mult * exponents[((-1 << bsize)) >> esize]; + mult1 = mult * exponents[(-(1 << bsize)) >> esize]; for (i = 0; i < n; i++) { *coefs++ = pwd->noise_table[pwd->noise_index] * mult1; pwd->noise_index = (pwd->noise_index + 1) -- 2.39.2