Skip to content

Commit 2981037

Browse files
committed
Fixed reading WAV files with odd chunk sizes.
These require a padding byte not included in the chunk size.
1 parent d76c1d0 commit 2981037

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

editor/import/resource_importer_wav.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
292292
loop_end = file->get_32();
293293
}
294294
}
295-
file->seek(file_pos + chunksize);
295+
// Move to the start of the next chunk. Note that RIFF requires a padding byte for odd
296+
// chunk sizes.
297+
file->seek(file_pos + chunksize + (chunksize & 1));
296298
}
297299

298300
// STEP 2, APPLY CONVERSIONS

0 commit comments

Comments
 (0)