aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-22 15:52:53 -0800
committerChris Robinson <[email protected]>2018-01-22 15:52:53 -0800
commita852ecf8cec2a8ae8deba78213891232ac4dd1ff (patch)
tree789e1729d2095753f8f4bb6a5883ff1cb0aad5fd
parentd6d6ec03f16dca3000fdc74dddda5e9a37dfdc6f (diff)
Ensure proper alignment when preserving data too
-rw-r--r--OpenAL32/alBuffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 0fda943f..7e8bf606 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -914,8 +914,9 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALsizei frames, enum UserFm
if((access&AL_PRESERVE_DATA_BIT_SOFT))
{
- /* Can only preserve data with the same format. */
- if(ALBuf->FmtChannels != DstChannels || ALBuf->OriginalType != SrcType)
+ /* Can only preserve data with the same format and alignment. */
+ if(ALBuf->FmtChannels != DstChannels || ALBuf->OriginalType != SrcType ||
+ ALBuf->OriginalAlign != align)
{
WriteUnlock(&ALBuf->lock);
return AL_INVALID_VALUE;