aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-10-08 13:49:42 +0100
committerReinhard Tartler <siretart@tauware.de>2012-03-18 17:50:35 +0100
commit58afe6061adf61c17a876ce22b4dae03d0c0299a (patch)
tree8fd8ffa132386f52c60599ddbae6c886089188a7
parent8c2ae575ad5f4aadad65186e4c7bc3f4db2a62c5 (diff)
downloadffmpeg-58afe6061adf61c17a876ce22b4dae03d0c0299a.tar.gz
dca: fix signed overflow in shift
Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 559c244d42be7a02c23976216b47fd63b80d6c7f) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/dca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index fad6bce7a9..19d24c55d1 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -902,7 +902,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);
}
for (; i < 32; i++)