aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/ac3.c
diff options
context:
space:
mode:
authorMichael Niedermayer2015-03-15 11:21:50 +0100
committerMichael Niedermayer2015-03-15 11:21:50 +0100
commite3f5b6f16d606b769a82cf4ef1647c4887419374 (patch)
treed37b15d37c542f76111e0ad3f56c7fa22a591941 /libavcodec/ac3.c
parent94ccbad488d1c315459b8dd22cebed114e72b226 (diff)
avcodec/ac3: Fix undefined shift in ff_ac3_bit_alloc_calc_mask()
Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3.c')
-rw-r--r--libavcodec/ac3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ac3.c b/libavcodec/ac3.c
index 29e132f5d1..c4fc77cbdf 100644
--- a/libavcodec/ac3.c
+++ b/libavcodec/ac3.c
@@ -200,9 +200,9 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
if (band >= AC3_CRITICAL_BANDS || dba_lengths[seg] > AC3_CRITICAL_BANDS-band)
return -1;
if (dba_values[seg] >= 4) {
- delta = (dba_values[seg] - 3) << 7;
+ delta = (dba_values[seg] - 3) * 128;
} else {
- delta = (dba_values[seg] - 4) << 7;
+ delta = (dba_values[seg] - 4) * 128;
}
for (i = 0; i < dba_lengths[seg]; i++) {
mask[band++] += delta;