Ensure proper alignment when preserving data too

This commit is contained in:
Chris Robinson
2018-01-22 15:52:53 -08:00
parent d6d6ec03f1
commit a852ecf8ce
+3 -2
View File
@@ -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;