From 20c4896b125c7926e57091aa3dbd82a6af1d2be4 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 15 Mar 2022 14:29:21 +0100 Subject: [PATCH] mfplat: Align buffers at no less than 16 bytes boundaries. This is what seems to be happening on Windows 10. On the other hand, I am not seeing on native the current behavior of interpreting a zero alignment parameter as a request to align to 64 bytes boundaries. Signed-off-by: Giovanni Mascellani Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfplat/buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index e3f863c6345..18c77c87ec2 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -1264,7 +1264,8 @@ static HRESULT memory_buffer_init(struct buffer *buffer, DWORD max_length, DWORD { size_t size; - if (!alignment) alignment = MF_64_BYTE_ALIGNMENT; + if (alignment < MF_16_BYTE_ALIGNMENT) + alignment = MF_16_BYTE_ALIGNMENT; alignment++; if (alignment & (alignment - 1))