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.…
==============================================================================
--- 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");