windowscodecs: IWICMetadataQueryReader::GetMetadataByName() should accept NULL for returned value.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-09-16 18:01:41 +08:00 committed by Alexandre Julliard
parent 2d5d3a892f
commit 1593f146ec
2 changed files with 5 additions and 1 deletions

View File

@ -589,7 +589,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW
PropVariantClear(&tk_id);
PropVariantClear(&tk_schema);
if (hr == S_OK)
if (hr == S_OK && value)
*value = new_value;
else
PropVariantClear(&new_value);

View File

@ -1606,6 +1606,10 @@ static void test_metadata_gif(void)
if (winetest_debug > 1)
trace("query: %s\n", decoder_data[i].query);
MultiByteToWideChar(CP_ACP, 0, decoder_data[i].query, -1, queryW, 256);
hr = IWICMetadataQueryReader_GetMetadataByName(queryreader, queryW, NULL);
ok(hr == decoder_data[i].hr, "GetMetadataByName(%s) returned %#x, expected %#x\n", wine_dbgstr_w(queryW), hr, decoder_data[i].hr);
PropVariantInit(&value);
hr = IWICMetadataQueryReader_GetMetadataByName(queryreader, queryW, &value);
ok(hr == decoder_data[i].hr, "GetMetadataByName(%s) returned %#x, expected %#x\n", wine_dbgstr_w(queryW), hr, decoder_data[i].hr);