summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-03-10 18:16:12 -0800
committerSteve Kondik <steve@cyngn.com>2016-03-10 18:16:12 -0800
commitf3692bced672d78488d7753006d3e8e732fa0e42 (patch)
tree551fc67ee1879f0273d6ad5419b3532cdacb14fc
parent7de711fdc11b1cf480e144bcee9d61678bca9487 (diff)
parent629255407ab28bef5e73f86113b3b76ffaa72c69 (diff)
downloadandroid_external_sonivox-f3692bced672d78488d7753006d3e8e732fa0e42.tar.gz
android_external_sonivox-f3692bced672d78488d7753006d3e8e732fa0e42.tar.bz2
android_external_sonivox-f3692bced672d78488d7753006d3e8e732fa0e42.zip
Merge tag 'android-6.0.1_r22' of https://android.googlesource.com/platform/external/sonivox into cm-13.0staging/cm-13.0+r22
Android 6.0.1 release 22
-rw-r--r--arm-wt-22k/lib_src/eas_wtengine.c33
-rw-r--r--arm-wt-22k/lib_src/eas_wtsynth.c8
2 files changed, 41 insertions, 0 deletions
diff --git a/arm-wt-22k/lib_src/eas_wtengine.c b/arm-wt-22k/lib_src/eas_wtengine.c
index 224f60d..854d4b4 100644
--- a/arm-wt-22k/lib_src/eas_wtengine.c
+++ b/arm-wt-22k/lib_src/eas_wtengine.c
@@ -32,6 +32,9 @@
* includes
*------------------------------------
*/
+#include "log/log.h"
+#include <cutils/log.h>
+
#include "eas_types.h"
#include "eas_math.h"
#include "eas_audioconst.h"
@@ -88,6 +91,11 @@ void WT_VoiceGain (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
/* initialize some local variables */
numSamples = pWTIntFrame->numSamples;
+ if (numSamples <= 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ return;
+ }
pMixBuffer = pWTIntFrame->pMixBuffer;
pInputBuffer = pWTIntFrame->pAudioBuffer;
@@ -182,6 +190,11 @@ void WT_Interpolate (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
/* initialize some local variables */
numSamples = pWTIntFrame->numSamples;
+ if (numSamples <= 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ return;
+ }
pOutputBuffer = pWTIntFrame->pAudioBuffer;
loopEnd = (const EAS_SAMPLE*) pWTVoice->loopEnd + 1;
@@ -275,6 +288,11 @@ void WT_InterpolateNoLoop (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
/* initialize some local variables */
numSamples = pWTIntFrame->numSamples;
+ if (numSamples <= 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ return;
+ }
pOutputBuffer = pWTIntFrame->pAudioBuffer;
phaseInc = pWTIntFrame->frame.phaseIncrement;
@@ -363,6 +381,11 @@ void WT_VoiceFilter (S_FILTER_CONTROL *pFilter, S_WT_INT_FRAME *pWTIntFrame)
/* initialize some local variables */
numSamples = pWTIntFrame->numSamples;
+ if (numSamples <= 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ return;
+ }
pAudioBuffer = pWTIntFrame->pAudioBuffer;
z1 = pFilter->z1;
@@ -426,6 +449,11 @@ void WT_VoiceFilter (S_FILTER_CONTROL *pFilter, S_WT_INT_FRAME *pWTIntFrame)
/* initialize some local variables */
numSamples = pWTIntFrame->numSamples;
+ if (numSamples <= 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ return;
+ }
pOutputBuffer = pWTIntFrame->pAudioBuffer;
phaseInc = pWTIntFrame->frame.phaseIncrement;
@@ -569,6 +597,11 @@ void WT_InterpolateMono (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
EAS_I8 *pLoopStart;
numSamples = pWTIntFrame->numSamples;
+ if (numSamples <= 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ return;
+ }
pMixBuffer = pWTIntFrame->pMixBuffer;
/* calculate gain increment */
diff --git a/arm-wt-22k/lib_src/eas_wtsynth.c b/arm-wt-22k/lib_src/eas_wtsynth.c
index 45cf4b1..9257951 100644
--- a/arm-wt-22k/lib_src/eas_wtsynth.c
+++ b/arm-wt-22k/lib_src/eas_wtsynth.c
@@ -28,6 +28,9 @@
*/
// includes
+#include "log/log.h"
+#include <cutils/log.h>
+
#include "eas_data.h"
#include "eas_report.h"
#include "eas_host.h"
@@ -467,6 +470,11 @@ EAS_BOOL WT_CheckSampleEnd (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame, E
} else {
pWTIntFrame->numSamples = numSamples;
}
+ if (pWTIntFrame->numSamples < 0) {
+ ALOGE("b/26366256");
+ android_errorWriteLog(0x534e4554, "26366256");
+ pWTIntFrame->numSamples = 0;
+ }
/* sound will be done this frame */
done = EAS_TRUE;