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

Unified Diff: content/browser/renderer_host/media/audio_input_renderer_host.cc

Issue 11647012: Improve validation when creating audio streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_input_renderer_host.cc
===================================================================
--- content/browser/renderer_host/media/audio_input_renderer_host.cc (revision 173637)
+++ content/browser/renderer_host/media/audio_input_renderer_host.cc (working copy)
@@ -212,7 +212,11 @@
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 @@
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.
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698