diff --git a/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs b/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs index 7510b48270..0fdc103d3a 100644 --- a/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs +++ b/src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs @@ -1902,7 +1902,7 @@ namespace Avalonia.Win32.Interop if (bufferLength > 0) { - var buffer = bufferLength <= 64 ? stackalloc byte[bufferLength] : new byte[bufferLength]; + var buffer = bufferLength <= 64 ? stackalloc byte[bufferLength + 8] : new byte[bufferLength]; fixed (byte* bufferPtr = buffer) {