summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-05-09 14:55:57 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-05-09 14:55:57 +0000
commitc883cb16fb6a0a79581c9a8f4fed4968bc074556 (patch)
tree934708fc81d80c34b1f802d1e648391bf0d2fc34
parent117e943be6548c6e2aed04892f37b5f387dc8f87 (diff)
parent5e4cf4726e12b1e3dce17f3872b4f823b7a1f3a0 (diff)
downloadsonivox-c883cb16fb6a0a79581c9a8f4fed4968bc074556.tar.gz
Merge "sonivox: Fix integer overflows in WT_CheckSampleEnd"android-s-beta-2android-s-beta-1
-rw-r--r--arm-wt-22k/lib_src/eas_wtsynth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arm-wt-22k/lib_src/eas_wtsynth.c b/arm-wt-22k/lib_src/eas_wtsynth.c
index d3ca3af..74f78f5 100644
--- a/arm-wt-22k/lib_src/eas_wtsynth.c
+++ b/arm-wt-22k/lib_src/eas_wtsynth.c
@@ -482,7 +482,7 @@ EAS_BOOL WT_CheckSampleEnd (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame, E
#endif
/* now account for the fractional portion */
/*lint -e{703} use shift for performance */
- numSamples = (EAS_I32) ((numSamples << NUM_PHASE_FRAC_BITS) - pWTVoice->phaseFrac);
+ numSamples = (numSamples << NUM_PHASE_FRAC_BITS) - (EAS_I32) pWTVoice->phaseFrac;
if (pWTIntFrame->frame.phaseIncrement) {
pWTIntFrame->numSamples = 1 + (numSamples / pWTIntFrame->frame.phaseIncrement);
} else {