From bfb7b82bccfb37b4b2754a2cb61a8240badc39bb Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Mon, 16 Jan 2017 22:46:50 +0100 Subject: [PATCH] - Fixed uninitialized data for libsndfile. According to the API docs, when opening a file for read, SF_INFO::format must be set to 0. Discovered with Valgrind while running Deus Vult 2 map01. --- src/sound/sndfile_decoder.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sound/sndfile_decoder.cpp b/src/sound/sndfile_decoder.cpp index b0c35c2a0..02f24b9da 100644 --- a/src/sound/sndfile_decoder.cpp +++ b/src/sound/sndfile_decoder.cpp @@ -60,6 +60,7 @@ bool SndFileDecoder::open(FileReader *reader) SF_VIRTUAL_IO sfio = { file_get_filelen, file_seek, file_read, file_write, file_tell }; Reader = reader; + SndInfo.format = 0; SndFile = sf_open_virtual(&sfio, SFM_READ, &SndInfo, this); if (SndFile) {