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

Unified Diff: media/audio/win/wavein_input_win.cc

Issue 10834013: Added DCHECK() to prevent NULL-pointer dereference (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DCHECK num_buffers_ instead now. Created 8 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: media/audio/win/wavein_input_win.cc
diff --git a/media/audio/win/wavein_input_win.cc b/media/audio/win/wavein_input_win.cc
index 7eb778d061c927198283c03ad0ff33e9c9fff712..3177e578696dd7db7a16112c4349c09857836edd 100644
--- a/media/audio/win/wavein_input_win.cc
+++ b/media/audio/win/wavein_input_win.cc
@@ -35,6 +35,7 @@ PCMWaveInAudioInputStream::PCMWaveInAudioInputStream(
num_buffers_(num_buffers),
buffer_(NULL),
channels_(params.channels()) {
+ DCHECK(num_buffers_ > 0);
James Hawkins 2012/07/26 17:20:27 DCHECK_LE(0, num_buffers_)
format_.wFormatTag = WAVE_FORMAT_PCM;
format_.nChannels = params.channels() > 2 ? 2 : params.channels();
format_.nSamplesPerSec = params.sample_rate();
« 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