Merge "sonivox: -Wno-unused-parameter."
am: 825ad522d5

* commit '825ad522d5616aa13db2eca36fc2e4d27dcbcd4e':
  sonivox: -Wno-unused-parameter.
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 @@
 
     /* 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 @@
 
     /* 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 @@
 
     /* 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 @@
 
     /* 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 @@
 
     /* 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 @@
     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 @@
         } 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;