dmime: Fix handling of NULL out pointer in QI.

This commit is contained in:
Nikolay Sivov 2014-05-04 20:35:15 +04:00 committed by Alexandre Julliard
parent 51a4fce54d
commit a596cbb847
2 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,9 @@ static HRESULT WINAPI DirectMusicSegmentState8_QueryInterface(IDirectMusicSegmen
TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
if (!ppobj)
return E_POINTER;
*ppobj = NULL;
if (IsEqualIID(riid, &IID_IUnknown) ||

View File

@ -293,6 +293,9 @@ static void test_COM_segmentstate(void)
ok(refcount == 4, "refcount == %u, expected 4\n", refcount);
refcount = IUnknown_Release(unk);
hr = IDirectMusicSegmentState8_QueryInterface(dmss8, &IID_IUnknown, NULL);
ok(hr == E_POINTER, "got %08x\n", hr);
while (IDirectMusicSegmentState8_Release(dmss8));
}