aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-10-08 13:49:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-04 01:00:04 +0100
commit37ce6ba425d70718b646ba49ec23761abd511d9e (patch)
treefb4db68b93a032b41d1f6231726b6329ad5652c5 /libavcodec
parentc2c83dcb322504807388f804d73d75a45fab004b (diff)
downloadffmpeg-37ce6ba425d70718b646ba49ec23761abd511d9e.tar.gz
dca: fix signed overflow in shift
Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 559c244d42be7a02c23976216b47fd63b80d6c7f) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 69df8f4597..24153ebdd2 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -905,7 +905,8 @@ static void qmf_32_subbands(DCAContext * s, int chans,
for (subindex = 0; subindex < 8; subindex++) {
/* Load in one sample from each subband and clear inactive subbands */
for (i = 0; i < sb_act; i++){
- uint32_t v = AV_RN32A(&samples_in[i][subindex]) ^ ((i-1)&2)<<30;
+ unsigned sign = (i - 1) & 2;
+ uint32_t v = AV_RN32A(&samples_in[i][subindex]) ^ sign << 30;
AV_WN32A(&s->raXin[i], v);
}