ref: f6c26e00005127bc6127618e8367fa815d755032
parent: ad333d0dc490f284dea152c43234cf0a4860df61
author: Jean-Marc Valin <[email protected]>
date: Sun Aug 26 20:16:38 EDT 2012
Fixes an overflow in silk_log2lin() that was triggered only in debug mode
--- a/silk/log2lin.c
+++ b/silk/log2lin.c
@@ -47,7 +47,7 @@
frac_Q7 = inLog_Q7 & 0x7F;
if( inLog_Q7 < 2048 ) {
/* Piece-wise parabolic approximation */
- out = silk_ADD_RSHIFT( out, silk_MUL( out, silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 );
+ out = silk_ADD_RSHIFT32( out, silk_MUL( out, silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) ), 7 );
} else {
/* Piece-wise parabolic approximation */
out = silk_MLA( out, silk_RSHIFT( out, 7 ), silk_SMLAWB( frac_Q7, silk_SMULBB( frac_Q7, 128 - frac_Q7 ), -174 ) );