ole32: Check for NULL parameter in ReleaseStgMedium().

libcef can call ReleaseStgMedium( NULL )

Signed-off-by: Chao Long <longchao@uniontech.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Chao Long 2020-09-28 09:31:11 +01:00 committed by Alexandre Julliard
parent c1c86f6686
commit 3956b52603
2 changed files with 8 additions and 0 deletions

View File

@ -2023,6 +2023,8 @@ found:
void WINAPI ReleaseStgMedium(
STGMEDIUM* pmedium)
{
if (!pmedium) return;
switch (pmedium->tymed)
{
case TYMED_HGLOBAL:

View File

@ -4610,6 +4610,11 @@ static void test_OleCreateStaticFromData(void)
IStorage_Release(storage);
}
static void test_ReleaseStgMedium( void )
{
ReleaseStgMedium( NULL );
}
START_TEST(ole2)
{
DWORD dwRegister;
@ -4661,6 +4666,7 @@ START_TEST(ole2)
test_data_cache_save_data();
test_data_cache_contents();
test_OleCreateStaticFromData();
test_ReleaseStgMedium();
CoUninitialize();
}