Sven Baars : wmp: Fix a crash in put_volume when basic_audio is NULL.
Alexandre Julliard
julliard at winehq.org
Mon Nov 25 09:12:27 CST 2019
Module: wine
Branch: stable
Commit: 7d8a34d6a1c5ad11f088603fa2e165cfb78ea1ef
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7d8a34d6a1c5ad11f088603fa2e165cfb78ea1ef
Author: Sven Baars <sven.wine at gmail.com>
Date: Sat Aug 17 18:50:16 2019 +0200
wmp: Fix a crash in put_volume when basic_audio is NULL.
Signed-off-by: Sven Baars <sven.wine at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 9e8cf8082c3523957f6b19f49e820d910c16faa7)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/wmp/player.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c
index 519ffa1d18..d578b0a16b 100644
--- a/dlls/wmp/player.c
+++ b/dlls/wmp/player.c
@@ -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)
More information about the wine-cvs
mailing list