Added DCHECK() to prevent NULL-pointer dereference

CID=103708
BUG=
TEST=
TBR=tommi

Review URL: https://chromiumcodereview.appspot.com/10834013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148476 0039d316-1c4b-4281-b951-d872f2087c98
parent dbdf043b
...@@ -35,6 +35,7 @@ PCMWaveInAudioInputStream::PCMWaveInAudioInputStream( ...@@ -35,6 +35,7 @@ PCMWaveInAudioInputStream::PCMWaveInAudioInputStream(
num_buffers_(num_buffers), num_buffers_(num_buffers),
buffer_(NULL), buffer_(NULL),
channels_(params.channels()) { channels_(params.channels()) {
DCHECK(num_buffers_ > 0);
format_.wFormatTag = WAVE_FORMAT_PCM; format_.wFormatTag = WAVE_FORMAT_PCM;
format_.nChannels = params.channels() > 2 ? 2 : params.channels(); format_.nChannels = params.channels() > 2 ? 2 : params.channels();
format_.nSamplesPerSec = params.sample_rate(); format_.nSamplesPerSec = params.sample_rate();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment