summaryrefslogtreecommitdiffstats
path: root/arm-wt-22k
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-04-04 18:30:47 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-04-04 18:30:47 -0700
commit74b8ef135f1361a1d01d68398841ee635763275c (patch)
treee916035245dd4f7e265b5ff253778ed2a4602e10 /arm-wt-22k
parent3ca92ed060beb312e6aa82d26916418a79a3756b (diff)
parent8e618348f91aaedc59d1d14c14d1f3eaf1e4c103 (diff)
downloadandroid_external_sonivox-74b8ef135f1361a1d01d68398841ee635763275c.zip
android_external_sonivox-74b8ef135f1361a1d01d68398841ee635763275c.tar.gz
android_external_sonivox-74b8ef135f1361a1d01d68398841ee635763275c.tar.bz2
Merge tag 'android-5.1.1_r37' into HEAD
Ticket: CYNGNOS-2213 Android 5.1.1 release 37
Diffstat (limited to 'arm-wt-22k')
-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;