diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-19 20:26:16 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-19 20:26:16 +0000 |
commit | 503bea2643350c6378de5f7a268b85cf2480e1ac (patch) | |
tree | 1c4a2e4ca92584ce5cf470d4ddc5d6ca31a8ec8a /content/browser/renderer_host/media/audio_input_renderer_host.cc | |
parent | 24f40c19945abea6a22c4c6c28cc95b9bf846cba (diff) | |
download | chromium_src-503bea2643350c6378de5f7a268b85cf2480e1ac.zip chromium_src-503bea2643350c6378de5f7a268b85cf2480e1ac.tar.gz chromium_src-503bea2643350c6378de5f7a268b85cf2480e1ac.tar.bz2 |
Improve validation when creating audio streams.
BUG=166795
Review URL: https://codereview.chromium.org/11647012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/media/audio_input_renderer_host.cc')
-rw-r--r-- | content/browser/renderer_host/media/audio_input_renderer_host.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc index dda4850..23f8c91 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc @@ -212,7 +212,11 @@ void AudioInputRendererHost::OnCreateStream( VLOG(1) << "AudioInputRendererHost::OnCreateStream(stream_id=" << stream_id << ")"; DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DCHECK(LookupById(stream_id) == NULL); + // media::AudioParameters is validated in the deserializer. + if (LookupById(stream_id) != NULL) { + SendErrorMessage(stream_id); + return; + } media::AudioParameters audio_params(params); @@ -227,7 +231,6 @@ void AudioInputRendererHost::OnCreateStream( params.bits_per_sample(), params.frames_per_buffer()); } - DCHECK_GT(audio_params.frames_per_buffer(), 0); uint32 buffer_size = audio_params.GetBytesPerBuffer(); // Create a new AudioEntry structure. |