diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-03-21 13:11:48 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-03-24 09:10:58 -0400 |
commit | be9e747bcc542c277d30f6c78a57b0940e0c5b5e (patch) | |
tree | 79158fc5841ac79b828672c0b63a0b1dba093220 /celt | |
parent | 02f3ac225f99512364dc69e45e3a849f83b96363 (diff) | |
download | libopus-be9e747bcc542c277d30f6c78a57b0940e0c5b5e.tar.gz |
Fixes overflows on CPUs with 16-bit ints
As reported by Giovanni Rovatti, this should fix some TI C55 issues.
Diffstat (limited to 'celt')
-rw-r--r-- | celt/bands.c | 2 | ||||
-rw-r--r-- | celt/rate.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/celt/bands.c b/celt/bands.c index 25f229e2..22a0034b 100644 --- a/celt/bands.c +++ b/celt/bands.c @@ -714,7 +714,7 @@ static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx, if (qn!=1) { if (encode) - itheta = (itheta*qn+8192)>>14; + itheta = (itheta*(opus_int32)qn+8192)>>14; /* Entropy coding of the angle. We use a uniform pdf for the time split, a step for stereo, and a triangular one for the rest. */ diff --git a/celt/rate.c b/celt/rate.c index b28d8fec..7dfa5be8 100644 --- a/celt/rate.c +++ b/celt/rate.c @@ -296,7 +296,7 @@ static OPUS_INLINE int interp_bits2pulses(const CELTMode *m, int start, int end, done = 0; for (j=end;j-->start;) { - int tmp = bits1[j] + (lo*bits2[j]>>ALLOC_STEPS); + int tmp = bits1[j] + ((opus_int32)lo*bits2[j]>>ALLOC_STEPS); if (tmp < thresh[j] && !done) { if (tmp >= alloc_floor) |