mfplat: Handle null destination for GetItem().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
39cc121640
commit
e1d23a336e
|
@ -1112,7 +1112,7 @@ HRESULT attributes_GetItem(struct attributes *attributes, REFGUID key, PROPVARIA
|
|||
EnterCriticalSection(&attributes->cs);
|
||||
|
||||
if ((attribute = attributes_find_item(attributes, key, NULL)))
|
||||
hr = PropVariantCopy(value, &attribute->value);
|
||||
hr = value ? PropVariantCopy(value, &attribute->value) : S_OK;
|
||||
else
|
||||
hr = MF_E_ATTRIBUTENOTFOUND;
|
||||
|
||||
|
|
|
@ -763,6 +763,12 @@ static void test_attributes(void)
|
|||
PropVariantClear(&ret_propvar);
|
||||
CHECK_ATTR_COUNT(attributes, 1);
|
||||
|
||||
hr = IMFAttributes_GetItem(attributes, &DUMMY_GUID1, NULL);
|
||||
ok(hr == S_OK, "Item check failed, hr %#x.\n", hr);
|
||||
|
||||
hr = IMFAttributes_GetItem(attributes, &DUMMY_GUID2, NULL);
|
||||
ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
PropVariantInit(&ret_propvar);
|
||||
ret_propvar.vt = MF_ATTRIBUTE_STRING;
|
||||
U(ret_propvar).pwszVal = NULL;
|
||||
|
|
Loading…
Reference in New Issue