Commit 76925b06 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Check pointer in IPicture_get_Attributes.

parent 5b88f0d9
......@@ -842,6 +842,10 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
{
OLEPictureImpl *This = (OLEPictureImpl *)iface;
TRACE("(%p)->(%p).\n", This, pdwAttr);
if(!pdwAttr)
return E_POINTER;
*pdwAttr = 0;
switch (This->desc.picType) {
case PICTYPE_UNINITIALIZED:
......
......@@ -663,6 +663,9 @@ static void test_get_Attributes(void)
ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08x\n", hres);
ok(type == PICTYPE_UNINITIALIZED, "Expected type = PICTYPE_UNINITIALIZED, got = %d\n", type);
hres = IPicture_get_Attributes(pic, NULL);
ole_expect(hres, E_POINTER);
attr = 0xdeadbeef;
hres = IPicture_get_Attributes(pic, &attr);
ole_expect(hres, S_OK);
......
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