Aric Stewart : dmime: Do not try to query a NULL direct sound buffer.
Alexandre Julliard
julliard at winehq.org
Wed Feb 26 15:45:05 CST 2014
Module: wine
Branch: master
Commit: fcae01672f2d480597a40850ff0386268b24791d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fcae01672f2d480597a40850ff0386268b24791d
Author: Aric Stewart <aric at codeweavers.com>
Date: Wed Feb 26 18:03:35 2014 +0900
dmime: Do not try to query a NULL direct sound buffer.
---
dlls/dmime/audiopath.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/dlls/dmime/audiopath.c b/dlls/dmime/audiopath.c
index 6b7a2f0..66e218c 100644
--- a/dlls/dmime/audiopath.c
+++ b/dlls/dmime/audiopath.c
@@ -108,21 +108,22 @@ static HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicAudioPath_GetObjectI
FIXME("(%p, %d, %d, %d, %s, %d, %s, %p): stub\n", This, dwPChannel, dwStage, dwBuffer, debugstr_dmguid(guidObject), dwIndex, debugstr_dmguid(iidInterface), ppObject);
switch (dwStage) {
- case DMUS_PATH_BUFFER:
- {
- if (IsEqualIID (iidInterface, &IID_IDirectSoundBuffer8)) {
- IDirectSoundBuffer8_QueryInterface (This->pDSBuffer, &IID_IDirectSoundBuffer8, ppObject);
- TRACE("returning %p\n",*ppObject);
- return S_OK;
- } else if (IsEqualIID (iidInterface, &IID_IDirectSound3DBuffer)) {
- IDirectSoundBuffer8_QueryInterface (This->pDSBuffer, &IID_IDirectSound3DBuffer, ppObject);
- TRACE("returning %p\n",*ppObject);
- return S_OK;
- } else {
- FIXME("Bad iid\n");
- }
- }
- break;
+ case DMUS_PATH_BUFFER:
+ if (This->pDSBuffer)
+ {
+ if (IsEqualIID (iidInterface, &IID_IDirectSoundBuffer8)) {
+ IDirectSoundBuffer8_QueryInterface (This->pDSBuffer, &IID_IDirectSoundBuffer8, ppObject);
+ TRACE("returning %p\n",*ppObject);
+ return S_OK;
+ } else if (IsEqualIID (iidInterface, &IID_IDirectSound3DBuffer)) {
+ IDirectSoundBuffer8_QueryInterface (This->pDSBuffer, &IID_IDirectSound3DBuffer, ppObject);
+ TRACE("returning %p\n",*ppObject);
+ return S_OK;
+ } else {
+ FIXME("Bad iid\n");
+ }
+ }
+ break;
case DMUS_PATH_PRIMARY_BUFFER: {
if (IsEqualIID (iidInterface, &IID_IDirectSound3DListener)) {
More information about the wine-cvs
mailing list