1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-01 19:00:34 +02:00

#279 fix overlapped memcpy in the VAG decoder

This commit is contained in:
XProger
2021-02-13 13:46:02 +03:00
parent ea8ec659e1
commit 9c70e5ba0f

View File

@@ -532,7 +532,9 @@ namespace Sound {
res += length;
if (bufferSize -= length) { // if data remained in buffer, move it to the beginning
memcpy(buffer, &buffer[sizeof(buffer) / sizeof(Frame) - bufferSize], bufferSize * sizeof(Frame));
for (int i = 0; i < bufferSize; i++) {
buffer[i] = buffer[sizeof(buffer) / sizeof(Frame) - bufferSize + i];
}
break;
}
}