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..
}
/* 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)