Adds sanity check for sample rate on iOS

BUG=b/62909493

Review-Url: https://codereview.webrtc.org/2978913002
Cr-Commit-Position: refs/heads/master@{#19000}
This commit is contained in:
henrika
2017-07-13 04:42:50 -07:00
committed by Commit Bot
parent f03ea04176
commit abcf112ae0

View File

@ -623,6 +623,12 @@ void AudioDeviceIOS::HandleSampleRateChange(float sample_rate) {
return;
}
// Extra sanity check to ensure that the new sample rate is valid.
if (session_sample_rate <= 0.0) {
RTCLogError(@"Sample rate is invalid: %f", session_sample_rate);
return;
}
// We need to adjust our format and buffer sizes.
// The stream format is about to be changed and it requires that we first
// stop and uninitialize the audio unit to deallocate its resources.