mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
Fixed potential crash in sndfile reader on Intel platform
https://mantis.zdoom.org/view.php?id=640
This commit is contained in:
parent
4c803b6615
commit
8a36bf5c09
1 changed files with 4 additions and 1 deletions
|
@ -163,7 +163,10 @@ size_t SndFileDecoder::read(char *buffer, size_t bytes)
|
|||
while(total < frames)
|
||||
{
|
||||
size_t todo = MIN<size_t>(frames-total, 64/SndInfo.channels);
|
||||
float tmp[64];
|
||||
|
||||
// libsndfile uses SSE optimization on Intel platform
|
||||
// This requires proper read buffer alignment
|
||||
alignas(16) float tmp[64];
|
||||
|
||||
size_t got = (size_t)sf_readf_float(SndFile, tmp, todo);
|
||||
if(got < todo) frames = total + got;
|
||||
|
|
Loading…
Reference in a new issue