From 7f732735cead0e1cd90c0d4d9a9ea2d942982bbb Mon Sep 17 00:00:00 2001 From: vsonnier Date: Sun, 18 Feb 2018 19:18:39 +0100 Subject: [PATCH] Fix #616 wrong WAV size reported in header (thanks @nsmith-) --- src/audio/AudioFileWAV.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/AudioFileWAV.cpp b/src/audio/AudioFileWAV.cpp index d0629ab..374fbf3 100644 --- a/src/audio/AudioFileWAV.cpp +++ b/src/audio/AudioFileWAV.cpp @@ -106,7 +106,7 @@ bool AudioFileWAV::closeFile() // Fix the data chunk header to contain the data size outputFileStream.seekp(dataChunkPos + 4); - write_word(outputFileStream, file_length - dataChunkPos + 8); + write_word(outputFileStream, file_length - (dataChunkPos + 8), 4); // Fix the file header to contain the proper RIFF chunk size, which is (file size - 8) bytes outputFileStream.seekp(0 + 4);