Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1371)

Unified Diff: webrtc/modules/audio_device/ios/audio_device_ios.mm

Issue 2978913002: Adds sanity check for sample rate on iOS (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698