From dfb10c4404e8486c36484bab79aafd839d56bbec Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 11 Jul 2008 15:15:42 +0000 Subject: [PATCH] check for NULL pointer svn path=/trunk/; revision=34425 --- reactos/dll/directx/dsound/dsound.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/dll/directx/dsound/dsound.c b/reactos/dll/directx/dsound/dsound.c index d1d869e1a4e..08f6e48d4a1 100644 --- a/reactos/dll/directx/dsound/dsound.c +++ b/reactos/dll/directx/dsound/dsound.c @@ -577,6 +577,11 @@ static HRESULT WINAPI IDirectSoundImpl_SetCooperativeLevel( 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");