diff options
author | Michael Wörner <michael.woerner@blickshift.de> | 2023-12-04 20:01:34 +0100 |
---|---|---|
committer | Michael Wörner <michael.woerner@blickshift.de> | 2023-12-04 20:01:34 +0100 |
commit | 29810376b8c47f74de7e513c86204c0dba00cb91 (patch) | |
tree | 25400c3aad6a6eef6a0a78c9567cba9d4b9e691f | |
parent | d76c1d0e516fedc535a2e394ab780cac79203477 (diff) | |
download | redot-engine-29810376b8c47f74de7e513c86204c0dba00cb91.tar.gz |
Fixed reading WAV files with odd chunk sizes.
These require a padding byte not included in the chunk size.
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index f3cb5bda32..c97b6a7579 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -292,7 +292,9 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s loop_end = file->get_32(); } } - file->seek(file_pos + chunksize); + // Move to the start of the next chunk. Note that RIFF requires a padding byte for odd + // chunk sizes. + file->seek(file_pos + chunksize + (chunksize & 1)); } // STEP 2, APPLY CONVERSIONS |