[ros-diffs] [cwittich] 34425: check for NULL pointer

cwittich at svn.reactos.org cwittich at svn.reactos.org
Fri Jul 11 17:15:43 CEST 2008


Author: cwittich
Date: Fri Jul 11 10:15:42 2008
New Revision: 34425

URL: http://svn.reactos.org/svn/reactos?rev=34425&view=rev
Log:
check for NULL pointer

Modified:
    trunk/reactos/dll/directx/dsound/dsound.c

Modified: trunk/reactos/dll/directx/dsound/dsound.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dsound/dsound.c?rev=34425&r1=34424&r2=34425&view=diff
==============================================================================
--- trunk/reactos/dll/directx/dsound/dsound.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/dsound/dsound.c [iso-8859-1] Fri Jul 11 10:15:42 2008
@@ -577,6 +577,11 @@
     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");



More information about the Ros-diffs mailing list