Robert Reif : dsound Add uninitialized check.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 3 06:37:48 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 88ff4321643cb74877d18424b37d833d347cde79
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=88ff4321643cb74877d18424b37d833d347cde79

Author: Robert Reif <reif at earthlink.net>
Date:   Tue Jan  3 12:11:27 2006 +0100

dsound Add uninitialized check.

---

 dlls/dsound/dsound.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 0163f8a..02bf016 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -584,10 +584,16 @@ static HRESULT WINAPI IDirectSoundImpl_S
     IDirectSoundImpl *This = (IDirectSoundImpl *)iface;
     TRACE("(%p,%p,%s)\n",This,hwnd,dumpCooperativeLevel(level));
 
+    if (This->device == NULL) {
+        WARN("not initialized\n");
+        return DSERR_UNINITIALIZED;
+    }
+
     if (level==DSSCL_PRIORITY || level==DSSCL_EXCLUSIVE) {
         WARN("level=%s not fully supported\n",
              level==DSSCL_PRIORITY ? "DSSCL_PRIORITY" : "DSSCL_EXCLUSIVE");
     }
+
     This->device->priolevel = level;
     return DS_OK;
 }




More information about the wine-cvs mailing list