Skip to content

Commit 8a36bf5

Browse files
committed
Fixed potential crash in sndfile reader on Intel platform
https://mantis.zdoom.org/view.php?id=640
1 parent 4c803b6 commit 8a36bf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sound/sndfile_decoder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ size_t SndFileDecoder::read(char *buffer, size_t bytes)
163163
while(total < frames)
164164
{
165165
size_t todo = MIN<size_t>(frames-total, 64/SndInfo.channels);
166-
float tmp[64];
166+
167+
// libsndfile uses SSE optimization on Intel platform
168+
// This requires proper read buffer alignment
169+
alignas(16) float tmp[64];
167170

168171
size_t got = (size_t)sf_readf_float(SndFile, tmp, todo);
169172
if(got < todo) frames = total + got;

0 commit comments

Comments
 (0)