Sony BNK: Verify the full beginning frame

This commit is contained in:
EdnessP 2023-07-10 00:26:05 +03:00
parent 142f4887e0
commit 508d69a41b

View File

@ -449,8 +449,11 @@ VGMSTREAM* init_vgmstream_bnk_sony(STREAMFILE* sf) {
stream_size += 0x10;
for (offset = data_offset + stream_offset + 0x10; offset < max_offset; offset += 0x10) {
/* beginning frame (if file loops won't have end frame) */
if (read_u32be(offset + 0x00, sf) == 0x00000000 && read_u32be(offset + 0x04, sf) == 0x00000000)
/* beginning frame (if file loops won't have end frame)
* checking the entire 16 byte block, as it is possible
* for just the first 8 bytes to be empty [Bully (PS2)] */
if (read_u32be(offset + 0x00, sf) == 0x00000000 && read_u32be(offset + 0x04, sf) == 0x00000000 &&
read_u32be(offset + 0x08, sf) == 0x00000000 && read_u32be(offset + 0x0C, sf) == 0x00000000)
break;
stream_size += 0x10;