summaryrefslogtreecommitdiff
path: root/libavcodec/dca.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-09 04:02:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-09 04:02:03 +0200
commitc5db8b4d09762f5228eaf3c3a0017657ed27d866 (patch)
tree59719cfc31a9e112b3f7099392506a6e1e54449f /libavcodec/dca.c
parent7fb92be7e50ea4ba5712804326c6814ae02dd190 (diff)
parenta31e9f68a426f634e002282885c6c2eb1bfbea44 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavf: fix signed overflow in avformat_find_stream_info() vp8: fix signed overflows motion_est: fix some signed overflows dca: fix signed overflow in shift aacdec: fix undefined shifts bink: Check for various out of bound writes bink: Check for out of bound writes when building tree put_bits: fix invalid shift by 32 in flush_put_bits() Conflicts: libavcodec/bink.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r--libavcodec/dca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 8c3cc4b720..d900d883bd 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -909,7 +909,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);
}