mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 02:04:46 +00:00
mfplat: Allow NULL size pointer in IMFAttributes::GetAllocatedBlob().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1336f5966f
commit
e3f226fde0
|
@ -2743,7 +2743,8 @@ HRESULT attributes_GetAllocatedBlob(struct attributes *attributes, REFGUID key,
|
|||
if (SUCCEEDED(hr))
|
||||
{
|
||||
*buf = attrval.caub.pElems;
|
||||
*size = attrval.caub.cElems;
|
||||
if (size)
|
||||
*size = attrval.caub.cElems;
|
||||
}
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -1749,6 +1749,11 @@ static void test_attributes(void)
|
|||
ok(!memcmp(blob_buf, blob, size), "Unexpected blob.\n");
|
||||
CoTaskMemFree(blob_buf);
|
||||
|
||||
hr = IMFAttributes_GetAllocatedBlob(attributes, &DUMMY_GUID1, &blob_buf, NULL);
|
||||
ok(hr == S_OK, "Failed to get allocated blob, hr %#lx.\n", hr);
|
||||
ok(!memcmp(blob_buf, blob, size), "Unexpected blob.\n");
|
||||
CoTaskMemFree(blob_buf);
|
||||
|
||||
hr = IMFAttributes_GetAllocatedBlob(attributes, &DUMMY_GUID2, &blob_buf, &size);
|
||||
ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue