Commit 3a0eb8bd authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Alexandre Julliard

mfplat: Fix MFGetPlaneSize() behavior for invalid formats.

parent ee8ddf37
......@@ -2755,10 +2755,10 @@ HRESULT WINAPI MFGetPlaneSize(DWORD fourcc, DWORD width, DWORD height, DWORD *si
memcpy(&subtype, &MFVideoFormat_Base, sizeof(subtype));
subtype.Data1 = fourcc;
if (!(format = mf_get_video_format(&subtype)))
return MF_E_INVALIDMEDIATYPE;
stride = mf_get_stride_for_format(format, width);
if ((format = mf_get_video_format(&subtype)))
stride = mf_get_stride_for_format(format, width);
else
stride = 0;
switch (fourcc)
{
......
......@@ -4254,6 +4254,11 @@ static void test_MFGetPlaneSize(void)
return;
}
size = 1;
hr = pMFGetPlaneSize(0xdeadbeef, 64, 64, &size);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(size == 0, "Unexpected size %u.\n", size);
for (i = 0; i < ARRAY_SIZE(image_size_tests); ++i)
{
const struct image_size_test *ptr = &image_size_tests[i];
......
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