Giovanni Mascellani : mfplat/buffer: Fix the image copy function for IMC2/IMC4 buffers with odd height.
Alexandre Julliard
julliard at winehq.org
Tue Jun 28 15:53:09 CDT 2022
Module: wine
Branch: master
Commit: fcb8edee6bcd0652cb43e1f59d967a59ba037940
URL: https://source.winehq.org/git/wine.git/?a=commit;h=fcb8edee6bcd0652cb43e1f59d967a59ba037940
Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date: Fri Jun 24 09:48:05 2022 +0200
mfplat/buffer: Fix the image copy function for IMC2/IMC4 buffers with odd height.
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mfplat/buffer.c | 3 +--
dlls/mfplat/tests/mfplat.c | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c
index 39407ccc9e2..a7ba306223d 100644
--- a/dlls/mfplat/buffer.c
+++ b/dlls/mfplat/buffer.c
@@ -100,8 +100,7 @@ static void copy_image_imc1(BYTE *dest, LONG dest_stride, const BYTE *src, LONG
static void copy_image_imc2(BYTE *dest, LONG dest_stride, const BYTE *src, LONG src_stride, DWORD width, DWORD lines)
{
- MFCopyImage(dest, dest_stride, src, src_stride, width / 2, lines / 2);
- MFCopyImage(dest + dest_stride / 2, dest_stride, src + src_stride / 2, src_stride, width / 2, lines / 2);
+ MFCopyImage(dest, dest_stride / 2, src, src_stride / 2, width / 2, lines);
}
static inline struct buffer *impl_from_IMFMediaBuffer(IMFMediaBuffer *iface)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index f09ae368ccc..48f7a444add 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -6073,7 +6073,6 @@ static void test_MFCreate2DMediaBuffer(void)
case MAKEFOURCC('I','M','C','4'):
for (j = 0; j < ptr->height; j++)
for (k = 0; k < stride / 2; k++)
- todo_wine_if(ptr->height % 2 == 1 && j >= 2)
ok(data[j * (pitch / 2) + k] == (((j + ptr->height) % 16) << 4) + (k % 16),
"Unexpected byte %02x instead of %02x at test %d row %d column %d.\n",
data[j * (pitch / 2) + k], (((j + ptr->height) % 16) << 4) + (k % 16), i, j + ptr->height, k);
More information about the wine-cvs
mailing list