mfplat: Fix MFGetPlaneSize() behavior for invalid formats.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Giovanni Mascellani 2022-02-14 21:46:25 +03:00 committed by Alexandre Julliard
parent ee8ddf37c9
commit 3a0eb8bde9
2 changed files with 9 additions and 4 deletions

View File

@ -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)
{

View File

@ -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];