aacdec: fix undefined shifts
Since nnz can be zero, this is needed to avoid a shift by 32.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d12294304a
)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:

committed by
Reinhard Tartler

parent
9c78fe9360
commit
8c2ae575ad
@@ -1088,7 +1088,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||||
cb_idx = cb_vector_idx[code];
|
cb_idx = cb_vector_idx[code];
|
||||||
nnz = cb_idx >> 8 & 15;
|
nnz = cb_idx >> 8 & 15;
|
||||||
bits = SHOW_UBITS(re, gb, nnz) << (32-nnz);
|
bits = nnz ? GET_CACHE(re, gb) : 0;
|
||||||
LAST_SKIP_BITS(re, gb, nnz);
|
LAST_SKIP_BITS(re, gb, nnz);
|
||||||
cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
|
cf = VMUL4S(cf, vq, cb_idx, bits, sf + idx);
|
||||||
} while (len -= 4);
|
} while (len -= 4);
|
||||||
@@ -1128,7 +1128,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
|||||||
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
GET_VLC(code, re, gb, vlc_tab, 8, 2);
|
||||||
cb_idx = cb_vector_idx[code];
|
cb_idx = cb_vector_idx[code];
|
||||||
nnz = cb_idx >> 8 & 15;
|
nnz = cb_idx >> 8 & 15;
|
||||||
sign = SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12);
|
sign = nnz ? SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
|
||||||
LAST_SKIP_BITS(re, gb, nnz);
|
LAST_SKIP_BITS(re, gb, nnz);
|
||||||
cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
|
cf = VMUL2S(cf, vq, cb_idx, sign, sf + idx);
|
||||||
} while (len -= 2);
|
} while (len -= 2);
|
||||||
|
Reference in New Issue
Block a user