Michael Stefaniuc : dmusic: Don't crash on NULL in IDirectMusicObject:: GetDescriptor.

Alexandre Julliard julliard at winehq.org
Mon Jan 6 14:47:12 CST 2014


Module: wine
Branch: master
Commit: fe0d2a2ba796dc0551cef08098a42a405738b421
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fe0d2a2ba796dc0551cef08098a42a405738b421

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Sun Jan  5 23:51:17 2014 +0100

dmusic: Don't crash on NULL in IDirectMusicObject::GetDescriptor.

---

 dlls/dmusic/collection.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c
index a519b2a..4c6a034 100644
--- a/dlls/dmusic/collection.c
+++ b/dlls/dmusic/collection.c
@@ -181,7 +181,9 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescripto
 
     TRACE("(%p/%p)->(%p)\n", iface, This, pDesc);
 
-    /* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
+    if (!pDesc)
+        return E_POINTER;
+
     memcpy (pDesc, This->pDesc, This->pDesc->dwSize);
 
     return S_OK;




More information about the wine-cvs mailing list