Commit 5e39af26 authored by David Adam's avatar David Adam Committed by Alexandre Julliard

dmloader: Fix a possible null dereference.

parent 993de4d8
...@@ -14505,6 +14505,14 @@ dlls/dmloader/Makefile: dlls/dmloader/Makefile.in dlls/Makedll.rules" ...@@ -14505,6 +14505,14 @@ dlls/dmloader/Makefile: dlls/dmloader/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/dmloader/Makefile" ac_config_files="$ac_config_files dlls/dmloader/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\ ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/dmloader/tests/Makefile"
test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\
dmloader/tests"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/dmloader/tests/Makefile: dlls/dmloader/tests/Makefile.in dlls/Maketest.rules"
ac_config_files="$ac_config_files dlls/dmloader/tests/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/dmscript/Makefile" dlls/dmscript/Makefile"
test "x$enable_dmscript" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ test "x$enable_dmscript" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
dmscript" dmscript"
...@@ -18839,6 +18847,7 @@ do ...@@ -18839,6 +18847,7 @@ do
"dlls/dmcompos/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmcompos/Makefile" ;; "dlls/dmcompos/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmcompos/Makefile" ;;
"dlls/dmime/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmime/Makefile" ;; "dlls/dmime/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmime/Makefile" ;;
"dlls/dmloader/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmloader/Makefile" ;; "dlls/dmloader/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmloader/Makefile" ;;
"dlls/dmloader/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmloader/tests/Makefile" ;;
"dlls/dmscript/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmscript/Makefile" ;; "dlls/dmscript/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmscript/Makefile" ;;
"dlls/dmstyle/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmstyle/Makefile" ;; "dlls/dmstyle/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmstyle/Makefile" ;;
"dlls/dmsynth/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmsynth/Makefile" ;; "dlls/dmsynth/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dmsynth/Makefile" ;;
......
...@@ -2224,6 +2224,7 @@ WINE_CONFIG_MAKEFILE([dlls/dmband/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL ...@@ -2224,6 +2224,7 @@ WINE_CONFIG_MAKEFILE([dlls/dmband/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL
WINE_CONFIG_MAKEFILE([dlls/dmcompos/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmcompos/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dmime/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmime/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dmloader/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmloader/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dmloader/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/dmscript/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmscript/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dmstyle/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmstyle/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/dmsynth/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmsynth/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
......
...@@ -644,6 +644,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (L ...@@ -644,6 +644,8 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (L
ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface);
TRACE("(%p, %p)\n", This, pObject); TRACE("(%p, %p)\n", This, pObject);
if(!pObject) return E_POINTER;
/* get descriptor */ /* get descriptor */
DM_STRUCT_INIT(&Desc); DM_STRUCT_INIT(&Desc);
IDirectMusicObject_GetDescriptor (pObject, &Desc); IDirectMusicObject_GetDescriptor (pObject, &Desc);
......
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = dmloader.dll
IMPORTS = ole32 kernel32
CTESTS = \
loader.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend
/*
* Copyright (C) 2010 David Adam
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#define COBJMACROS
#include "initguid.h"
#include "dmusici.h"
#include "wine/test.h"
static void test_release_object(void)
{
HRESULT hr;
IDirectMusicLoader8* loader = NULL;
hr = CoInitialize(NULL);
if ( FAILED(hr) )
{
skip("CoInitialize failed.\n");
return;
}
hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, &IID_IDirectMusicLoader8, (void**)&loader);
if ( FAILED(hr) )
{
skip("CoCreateInstance failed.\n");
CoUninitialize();
return;
}
hr = IDirectMusicLoader_ReleaseObject(loader, NULL);
ok(hr == E_POINTER, "Expected E_POINTER, received %#x\n", hr);
IDirectMusicLoader_Release(loader);
CoUninitialize();
}
START_TEST(loader)
{
test_release_object();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment