diff options
author | inferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 20:39:33 +0000 |
---|---|---|
committer | inferno@chromium.org <inferno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 20:39:33 +0000 |
commit | a6d7ae5e4b8ab5b72c1e6dd59809c13369e51df2 (patch) | |
tree | da67a4e6dab1fc371193fe34915e11b6db90870d /media | |
parent | 96fd9e0e732f69917a6037b195081c3cbd614421 (diff) | |
download | chromium_src-a6d7ae5e4b8ab5b72c1e6dd59809c13369e51df2.zip chromium_src-a6d7ae5e4b8ab5b72c1e6dd59809c13369e51df2.tar.gz chromium_src-a6d7ae5e4b8ab5b72c1e6dd59809c13369e51df2.tar.bz2 |
Turn the volume range check into a bail out return to prevent browser crash.
BUG=68244
TEST=None
Review URL: http://codereview.chromium.org/6133001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/audio_util.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/media/audio/audio_util.cc b/media/audio/audio_util.cc index 4c8be79..117d7df 100644 --- a/media/audio/audio_util.cc +++ b/media/audio/audio_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -93,7 +93,8 @@ bool AdjustVolume(void* buf, int bytes_per_sample, float volume) { DCHECK(buf); - DCHECK(volume >= 0.0f && volume <= 1.0f); + if (volume < 0.0f || volume > 1.0f) + return false; if (volume == 1.0f) { return true; } else if (volume == 0.0f) { @@ -129,7 +130,8 @@ bool FoldChannels(void* buf, int bytes_per_sample, float volume) { DCHECK(buf); - DCHECK(volume >= 0.0f && volume <= 1.0f); + if (volume < 0.0f || volume > 1.0f) + return false; if (channels > 2 && channels <= 8 && bytes_per_sample > 0) { int sample_count = buflen / (channels * bytes_per_sample); if (bytes_per_sample == 1) { |