Merge pull request #1394 from hcs64/short-str-wav

Allow a str+wav header to end at table1
This commit is contained in:
bnnm 2023-07-10 17:30:34 +02:00 committed by GitHub
commit 78aae40f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -583,11 +583,17 @@ static int parse_header(STREAMFILE* sf_h, STREAMFILE* sf_b, strwav_header* strwa
return 1;
}
/* Bad Boys II (PC)[2004] */
/* Pac-Man World 3 (PC)[2005] */
if ((read_u32be(0x04,sf_h) == 0x00000800 ||
read_u32be(0x04,sf_h) == 0x01000800) && /* rare, mu_spectral1_explore_2 */
read_u32le(0x24,sf_h) == read_u32le(0x114,sf_h) && /* sample rate repeat */
read_u32le(0x130,sf_h) + read_u32le(0x134,sf_h) * 0x40 == header_size /* ~0x140 + cues */
(
// check if the header ends at table1 (Bad Boys)
read_u32le(0x128,sf_h) * 0x4 + read_u32le(0x12c, sf_h) == header_size ||
// otherwise it ends at table2
read_u32le(0x130,sf_h) + read_u32le(0x134,sf_h) * 0x40 == header_size /* ~0x140 + cues */
)
) {
/* 0x08: null */
/* 0x0c: hashname */