Commit a22ca1c2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Check pointer in IPicture::get_Handle.

parent 65b3393d
...@@ -519,6 +519,10 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface, ...@@ -519,6 +519,10 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
{ {
OLEPictureImpl *This = (OLEPictureImpl *)iface; OLEPictureImpl *This = (OLEPictureImpl *)iface;
TRACE("(%p)->(%p)\n", This, phandle); TRACE("(%p)->(%p)\n", This, phandle);
if(!phandle)
return E_POINTER;
switch(This->desc.picType) { switch(This->desc.picType) {
case PICTYPE_NONE: case PICTYPE_NONE:
case PICTYPE_UNINITIALIZED: case PICTYPE_UNINITIALIZED:
......
...@@ -674,6 +674,19 @@ static void test_get_Attributes(void) ...@@ -674,6 +674,19 @@ static void test_get_Attributes(void)
IPicture_Release(pic); IPicture_Release(pic);
} }
static void test_get_Handle(void)
{
IPicture *pic;
HRESULT hres;
OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (VOID**)&pic);
hres = IPicture_get_Handle(pic, NULL);
ole_expect(hres, E_POINTER);
IPicture_Release(pic);
}
START_TEST(olepicture) START_TEST(olepicture)
{ {
hOleaut32 = GetModuleHandleA("oleaut32.dll"); hOleaut32 = GetModuleHandleA("oleaut32.dll");
...@@ -702,6 +715,7 @@ START_TEST(olepicture) ...@@ -702,6 +715,7 @@ START_TEST(olepicture)
test_OleCreatePictureIndirect(); test_OleCreatePictureIndirect();
test_Render(); test_Render();
test_get_Attributes(); test_get_Attributes();
test_get_Handle();
} }
......
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