wmp: Fix a crash in put_volume when basic_audio is NULL.

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 9e8cf8082c)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Sven Baars 2019-08-17 18:50:16 +02:00 committed by Michael Stefaniuc
parent cc0b0b9fcf
commit 7d8a34d6a1
1 changed files with 9 additions and 9 deletions

View File

@ -969,18 +969,18 @@ static HRESULT WINAPI WMPSettings_get_volume(IWMPSettings *iface, LONG *p)
static HRESULT WINAPI WMPSettings_put_volume(IWMPSettings *iface, LONG v)
{
HRESULT hres;
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
TRACE("(%p)->(%d)\n", This, v);
This->volume = v;
if (!This->filter_graph) {
hres = S_OK;
} else {
/* IBasicAudio - [-10000, 0], wmp - [0, 100] */
v = 10000 * v / 100 - 10000;
hres = IBasicAudio_put_Volume(This->basic_audio, v);
}
return hres;
if (!This->filter_graph)
return S_OK;
/* IBasicAudio - [-10000, 0], wmp - [0, 100] */
v = 10000 * v / 100 - 10000;
if (!This->basic_audio)
return S_FALSE;
return IBasicAudio_put_Volume(This->basic_audio, v);
}
static HRESULT WINAPI WMPSettings_getMode(IWMPSettings *iface, BSTR mode, VARIANT_BOOL *p)