[PATCH 5/6] mfplat: Align buffers at no less than 16 bytes boundaries.

Giovanni Mascellani gmascellani at codeweavers.com
Tue Mar 15 08:29:21 CDT 2022


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 <gmascellani at codeweavers.com>
---
 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))
-- 
2.35.1




More information about the wine-devel mailing list