[vlc-commits] mmdevice: guard against out of range values
Rémi Denis-Courmont
git at videolan.org
Sat Mar 1 20:44:21 CET 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 1 19:54:06 2014 +0200| [fa4b63c8737218952edf75c27a8e27b4baefd5fc] | committer: Rémi Denis-Courmont
mmdevice: guard against out of range values
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fa4b63c8737218952edf75c27a8e27b4baefd5fc
---
modules/audio_output/mmdevice.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index c84aa01..80894ff 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -804,6 +804,9 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it)
{
if (volume != NULL && sys->volume >= 0.f)
{
+ if (sys->volume > 1.f)
+ sys->volume = 1.f;
+
hr = ISimpleAudioVolume_SetMasterVolume(volume, sys->volume, NULL);
if (FAILED(hr))
msg_Err(aout, "cannot set master volume (error 0x%lx)", hr);
More information about the vlc-commits
mailing list