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

mfplat: Handle null destination for GetItem().

parent 39cc1216
......@@ -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;
......
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