Merge pull request #36405 from gaurav1086:center_frequencies_index_access_check

PiperOrigin-RevId: 297377152
Change-Id: I95a0976c1a35c7fc5b2d1a3b052f4dd2124c7b0b
This commit is contained in:
TensorFlower Gardener 2020-02-26 09:28:31 -08:00
commit e1e56a8fe0

View File

@ -100,8 +100,8 @@ bool MfccMelFilterbank::Initialize(int input_length, double input_sample_rate,
if ((i < start_index_) || (i > end_index_)) {
band_mapper_[i] = -2; // Indicate an unused Fourier coefficient.
} else {
while ((center_frequencies_[channel] < melf) &&
(channel < num_channels_)) {
while ((channel < num_channels_) &&
(center_frequencies_[channel] < melf)) {
++channel;
}
band_mapper_[i] = channel - 1; // Can be == -1