From f1f07e66e3caaf4f633592f7d121c4b938899f49 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 29 Apr 2010 18:06:09 -0700 Subject: fixed potential buffer overrun in volume code --- indra/media_plugins/winmmshim/winmm_shim.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/winmmshim/winmm_shim.cpp b/indra/media_plugins/winmmshim/winmm_shim.cpp index f7df3b19a0..54bfa652e9 100644 --- a/indra/media_plugins/winmmshim/winmm_shim.cpp +++ b/indra/media_plugins/winmmshim/winmm_shim.cpp @@ -144,10 +144,11 @@ extern "C" // copy volume level 4 times into 64 bit MMX register __m64 volume_64 = _mm_set_pi16(volume_16, volume_16, volume_16, volume_16); - __m64 *sample_64; + __m64* sample_64; + __m64* last_sample_64 = (__m64*)(pwh->lpData + pwh->dwBufferLength - sizeof(__m64)); // for everything that can be addressed in 64 bit multiples... for (sample_64 = (__m64*)pwh->lpData; - sample_64 < (__m64*)(pwh->lpData + pwh->dwBufferLength); + sample_64 <= last_sample_64; ++sample_64) { //...multiply the samples by the volume... -- cgit v1.2.3 From cb96bdc188b7177d253426e398932426276762f8 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 28 Apr 2010 18:06:34 -0700 Subject: Fixed default pan value in mac volume catcher, and corrected the filename in the header comment. --- indra/media_plugins/webkit/mac_volume_catcher.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/webkit/mac_volume_catcher.cpp b/indra/media_plugins/webkit/mac_volume_catcher.cpp index 9788f10a58..38727e5965 100644 --- a/indra/media_plugins/webkit/mac_volume_catcher.cpp +++ b/indra/media_plugins/webkit/mac_volume_catcher.cpp @@ -1,5 +1,5 @@ /** - * @file dummy_volume_catcher.cpp + * @file mac_volume_catcher.cpp * @brief A Mac OS X specific hack to control the volume level of all audio channels opened by a process. * * @cond @@ -98,7 +98,7 @@ VolumeCatcherImpl *VolumeCatcherImpl::getInstance() VolumeCatcherImpl::VolumeCatcherImpl() { mVolume = 1.0; // default to full volume - mPan = 0.5; // and center pan + mPan = 0.0; // and center pan ComponentDescription desc; desc.componentType = kAudioUnitType_Output; -- cgit v1.2.3