Skip to content

Commit 67be089

Browse files
ziqinghjulliard
authored andcommitted
mfplat: Fix stride calculation for RGB24.
1 parent 3dd09ed commit 67be089

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

dlls/mfplat/mediatype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,7 @@ static int __cdecl uncompressed_video_format_compare(const void *a, const void *
26312631

26322632
static const struct uncompressed_video_format video_formats[] =
26332633
{
2634-
{ &MFVideoFormat_RGB24, 4, 3, 1, 0 },
2634+
{ &MFVideoFormat_RGB24, 3, 3, 1, 0 },
26352635
{ &MFVideoFormat_ARGB32, 4, 3, 1, 0 },
26362636
{ &MFVideoFormat_RGB32, 4, 3, 1, 0 },
26372637
{ &MFVideoFormat_RGB565, 2, 3, 1, 0 },

dlls/mfplat/tests/mfplat.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,8 +4393,7 @@ static void test_MFCalculateImageSize(void)
43934393
todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype) || IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11))
43944394
ok(hr == S_OK || (is_broken && hr == E_INVALIDARG), "%u: failed to calculate image size, hr %#lx.\n", i, hr);
43954395
todo_wine_if(is_MEDIASUBTYPE_RGB(ptr->subtype)
4396-
|| IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)
4397-
|| (IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0))
4396+
|| IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11))
43984397
ok(size == ptr->size, "%u: unexpected image size %u, expected %u. Size %u x %u, format %s.\n", i, size, ptr->size,
43994398
ptr->width, ptr->height, wine_dbgstr_an((char *)&ptr->subtype->Data1, 4));
44004399
}
@@ -4426,8 +4425,7 @@ static void test_MFGetPlaneSize(void)
44264425

44274426
hr = pMFGetPlaneSize(ptr->subtype->Data1, ptr->width, ptr->height, &size);
44284427
ok(hr == S_OK, "%u: failed to get plane size, hr %#lx.\n", i, hr);
4429-
todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11)
4430-
|| (IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0))
4428+
todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_NV11))
44314429
ok(size == plane_size, "%u: unexpected plane size %lu, expected %u. Size %u x %u, format %s.\n", i, size, plane_size,
44324430
ptr->width, ptr->height, wine_dbgstr_an((char*)&ptr->subtype->Data1, 4));
44334431
}
@@ -5994,13 +5992,11 @@ static void test_MFCreate2DMediaBuffer(void)
59945992

59955993
hr = IMF2DBuffer_GetContiguousLength(_2dbuffer, &length);
59965994
ok(hr == S_OK, "Failed to get length, hr %#lx.\n", hr);
5997-
todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0)
59985995
ok(length == ptr->contiguous_length, "%d: unexpected contiguous length %lu for %u x %u, format %s.\n",
59995996
i, length, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype));
60005997

60015998
hr = IMFMediaBuffer_Lock(buffer, &data, &length2, NULL);
60025999
ok(hr == S_OK, "Failed to lock buffer, hr %#lx.\n", hr);
6003-
todo_wine_if(IsEqualGUID(ptr->subtype, &MFVideoFormat_RGB24) && ptr->width % 4 == 0)
60046000
ok(length2 == ptr->contiguous_length, "%d: unexpected linear buffer length %lu for %u x %u, format %s.\n",
60056001
i, length2, ptr->width, ptr->height, wine_dbgstr_guid(ptr->subtype));
60066002

0 commit comments

Comments
 (0)