@@ -99,6 +99,10 @@ void WT_VoiceGain (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
99
99
ALOGE ("b/26366256" );
100
100
android_errorWriteLog (0x534e4554 , "26366256" );
101
101
return ;
102
+ } else if (numSamples > BUFFER_SIZE_IN_MONO_SAMPLES ) {
103
+ ALOGE ("b/317780080 clip numSamples %ld -> %d" , numSamples , BUFFER_SIZE_IN_MONO_SAMPLES );
104
+ android_errorWriteLog (0x534e4554 , "317780080" );
105
+ numSamples = BUFFER_SIZE_IN_MONO_SAMPLES ;
102
106
}
103
107
pMixBuffer = pWTIntFrame -> pMixBuffer ;
104
108
pInputBuffer = pWTIntFrame -> pAudioBuffer ;
@@ -196,6 +200,10 @@ void WT_Interpolate (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
196
200
ALOGE ("b/26366256" );
197
201
android_errorWriteLog (0x534e4554 , "26366256" );
198
202
return ;
203
+ } else if (numSamples > BUFFER_SIZE_IN_MONO_SAMPLES ) {
204
+ ALOGE ("b/317780080 clip numSamples %ld -> %d" , numSamples , BUFFER_SIZE_IN_MONO_SAMPLES );
205
+ android_errorWriteLog (0x534e4554 , "317780080" );
206
+ numSamples = BUFFER_SIZE_IN_MONO_SAMPLES ;
199
207
}
200
208
pOutputBuffer = pWTIntFrame -> pAudioBuffer ;
201
209
@@ -297,6 +305,10 @@ void WT_InterpolateNoLoop (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
297
305
ALOGE ("b/26366256" );
298
306
android_errorWriteLog (0x534e4554 , "26366256" );
299
307
return ;
308
+ } else if (numSamples > BUFFER_SIZE_IN_MONO_SAMPLES ) {
309
+ ALOGE ("b/317780080 clip numSamples %ld -> %d" , numSamples , BUFFER_SIZE_IN_MONO_SAMPLES );
310
+ android_errorWriteLog (0x534e4554 , "317780080" );
311
+ numSamples = BUFFER_SIZE_IN_MONO_SAMPLES ;
300
312
}
301
313
pOutputBuffer = pWTIntFrame -> pAudioBuffer ;
302
314
@@ -397,6 +409,10 @@ void WT_VoiceFilter (S_FILTER_CONTROL *pFilter, S_WT_INT_FRAME *pWTIntFrame)
397
409
ALOGE ("b/26366256" );
398
410
android_errorWriteLog (0x534e4554 , "26366256" );
399
411
return ;
412
+ } else if (numSamples > BUFFER_SIZE_IN_MONO_SAMPLES ) {
413
+ ALOGE ("b/317780080 clip numSamples %ld -> %d" , numSamples , BUFFER_SIZE_IN_MONO_SAMPLES );
414
+ android_errorWriteLog (0x534e4554 , "317780080" );
415
+ numSamples = BUFFER_SIZE_IN_MONO_SAMPLES ;
400
416
}
401
417
pAudioBuffer = pWTIntFrame -> pAudioBuffer ;
402
418
@@ -465,6 +481,10 @@ void WT_VoiceFilter (S_FILTER_CONTROL *pFilter, S_WT_INT_FRAME *pWTIntFrame)
465
481
ALOGE ("b/26366256" );
466
482
android_errorWriteLog (0x534e4554 , "26366256" );
467
483
return ;
484
+ } else if (numSamples > BUFFER_SIZE_IN_MONO_SAMPLES ) {
485
+ ALOGE ("b/317780080 clip numSamples %ld -> %d" , numSamples , BUFFER_SIZE_IN_MONO_SAMPLES );
486
+ android_errorWriteLog (0x534e4554 , "317780080" );
487
+ numSamples = BUFFER_SIZE_IN_MONO_SAMPLES ;
468
488
}
469
489
pOutputBuffer = pWTIntFrame -> pAudioBuffer ;
470
490
phaseInc = pWTIntFrame -> frame .phaseIncrement ;
@@ -613,6 +633,10 @@ void WT_InterpolateMono (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame)
613
633
ALOGE ("b/26366256" );
614
634
android_errorWriteLog (0x534e4554 , "26366256" );
615
635
return ;
636
+ } else if (numSamples > BUFFER_SIZE_IN_MONO_SAMPLES ) {
637
+ ALOGE ("b/317780080 clip numSamples %ld -> %d" , numSamples , BUFFER_SIZE_IN_MONO_SAMPLES );
638
+ android_errorWriteLog (0x534e4554 , "317780080" );
639
+ numSamples = BUFFER_SIZE_IN_MONO_SAMPLES ;
616
640
}
617
641
pMixBuffer = pWTIntFrame -> pMixBuffer ;
618
642
0 commit comments