amerkoleci / Vortice.Windows

.NET bindings for Direct3D12, Direct3D11, WIC, Direct2D1, XInput, XAudio, X3DAudio, DXC, Direct3D9 and DirectInput.
MIT License
1.01k stars 73 forks source link

MaxBufferBytes is too large for a signed int #316

Closed paulbartrum closed 2 years ago

paulbartrum commented 2 years ago

XAUDIO2_MAX_BUFFER_BYTES is defined to be 0x80000000 in C++, which is too large for a signed int. In Vortice it wraps around into the negatives, meaning code like if (myBufferSize >= XAudio2.MaxBufferBytes) will always be true.

amerkoleci commented 2 years ago

Thanks!