Commit fa4b63c8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mmdevice: guard against out of range values

parent d280b44e
...@@ -804,6 +804,9 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it) ...@@ -804,6 +804,9 @@ static HRESULT MMSession(audio_output_t *aout, IMMDeviceEnumerator *it)
{ {
if (volume != NULL && sys->volume >= 0.f) if (volume != NULL && sys->volume >= 0.f)
{ {
if (sys->volume > 1.f)
sys->volume = 1.f;
hr = ISimpleAudioVolume_SetMasterVolume(volume, sys->volume, NULL); hr = ISimpleAudioVolume_SetMasterVolume(volume, sys->volume, NULL);
if (FAILED(hr)) if (FAILED(hr))
msg_Err(aout, "cannot set master volume (error 0x%lx)", hr); msg_Err(aout, "cannot set master volume (error 0x%lx)", hr);
......
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