diff --git a/src/meta/ps2_svag.c b/src/meta/ps2_svag.c index beae5882..4b9bc17d 100644 --- a/src/meta/ps2_svag.c +++ b/src/meta/ps2_svag.c @@ -1,7 +1,7 @@ #include "meta.h" #include "../coding/coding.h" -/* SVAG - from Konami Tokyo games [OZ (PS2), Neo Contra (PS2)]] */ +/* SVAG - from Konami Tokyo games [OZ (PS2), Neo Contra (PS2), Silent Hill 2 (PS2)] */ VGMSTREAM * init_vgmstream_ps2_svag(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; off_t start_offset; @@ -12,14 +12,17 @@ VGMSTREAM * init_vgmstream_ps2_svag(STREAMFILE *streamFile) { /* checks */ if (!check_extensions(streamFile, "svag")) goto fail; - if (read_32bitBE(0x00,streamFile) != 0x53766167) /* "Svag" */ goto fail; channel_count = read_16bitLE(0x0C,streamFile); /* always 2? ("S"tereo vag?) */ loop_flag = (read_32bitLE(0x14,streamFile)==1); - start_offset = 0x800; /* header repeated at 0x400 too */ + /* header repeated at 0x400 presumably for stereo */ + if (channel_count > 1 && read_32bitBE(0x400,streamFile) != 0x53766167) /* "Svag" */ + goto fail; + + start_offset = 0x800; data_size = read_32bitLE(0x04,streamFile);