Index: webrtc/modules/audio_device/ios/audio_device_ios.mm |
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.mm b/webrtc/modules/audio_device/ios/audio_device_ios.mm |
index 3dcd48f2dcb97f3a5476344aae5959bb0cf29107..1d59aff46756ff51d86234b98c14383de1b098be 100644 |
--- a/webrtc/modules/audio_device/ios/audio_device_ios.mm |
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.mm |
@@ -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. |