mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 02:04:46 +00:00
mfplat: Allow NULL length pointer in IMFAttributes::GetAllocatedString.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d686663d22
commit
ca10760d2e
|
@ -2670,7 +2670,8 @@ HRESULT attributes_GetAllocatedString(struct attributes *attributes, REFGUID key
|
|||
if (SUCCEEDED(hr))
|
||||
{
|
||||
*value = attrval.pwszVal;
|
||||
*length = lstrlenW(*value);
|
||||
if (length)
|
||||
*length = lstrlenW(*value);
|
||||
}
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -1638,6 +1638,11 @@ static void test_attributes(void)
|
|||
ok(hr == S_OK, "Failed to get string length, hr %#lx.\n", hr);
|
||||
ok(string_length == lstrlenW(stringW), "Unexpected length %u.\n", string_length);
|
||||
|
||||
hr = IMFAttributes_GetAllocatedString(attributes, &DUMMY_GUID1, &string, NULL);
|
||||
ok(hr == S_OK, "Failed to get allocated string, hr %#lx.\n", hr);
|
||||
ok(!lstrcmpW(string, stringW), "Unexpected string %s.\n", wine_dbgstr_w(string));
|
||||
CoTaskMemFree(string);
|
||||
|
||||
string_length = 0xdeadbeef;
|
||||
hr = IMFAttributes_GetAllocatedString(attributes, &DUMMY_GUID1, &string, &string_length);
|
||||
ok(hr == S_OK, "Failed to get allocated string, hr %#lx.\n", hr);
|
||||
|
|
Loading…
Reference in a new issue