浏览代码

Merge pull request #85556 from bs-mwoerner/wav-import-fix

Fix importing WAV files with odd chunk sizes
Rémi Verschelde 1 年之前
父节点
当前提交
6cfb3f61f2
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      editor/import/resource_importer_wav.cpp

+ 3 - 1
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