diff options
author | Chris Robinson <[email protected]> | 2018-01-22 15:52:53 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-22 15:52:53 -0800 |
commit | a852ecf8cec2a8ae8deba78213891232ac4dd1ff (patch) | |
tree | 789e1729d2095753f8f4bb6a5883ff1cb0aad5fd /OpenAL32/alBuffer.c | |
parent | d6d6ec03f16dca3000fdc74dddda5e9a37dfdc6f (diff) |
Ensure proper alignment when preserving data too
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r-- | OpenAL32/alBuffer.c | 5 |
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; |