a few fixes for insufficiently strict checks

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@485 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
halleyscometsw 2008-11-23 12:08:33 +00:00
parent b8102c7a7e
commit aebdd634ee
2 changed files with 6 additions and 5 deletions

View File

@ -19,6 +19,7 @@ VGMSTREAM * init_vgmstream_nds_strm(STREAMFILE *streamFile) {
/* check header */
if ((uint32_t)read_32bitBE(0x00,streamFile)!=0x5354524D) /* STRM */
goto fail;
if (read_32bitBE(0x04,streamFile)!=0xFFFE0001) { /* Old Header Check */
goto fail;
} else if (read_32bitBE(0x04,streamFile)!=0xFEFF0001) { /* Some newer games have a new flag */

View File

@ -19,11 +19,11 @@ VGMSTREAM * init_vgmstream_waa_wac_wad_wam(STREAMFILE *streamFile) {
strcasecmp("wam",filename_extension(filename))) goto fail;
/* check header */
if (read_32bitBE(0x00,streamFile) != 0x52494646 && /* "RIFF" */
read_32bitBE(0x08,streamFile) != 0x57415645 && /* "WAVE" */
read_32bitBE(0xCC,streamFile) != 0x666D7420 && /* "fmt\0x20" */
read_32bitBE(0x10,streamFile) != 0x12000000 && /* "0x12000000" */
read_16bitBE(0x14,streamFile) != 0xFEFF) /* "FEFF" */
if (read_32bitBE(0x00,streamFile) != 0x52494646 || /* "RIFF" */
read_32bitBE(0x08,streamFile) != 0x57415645 || /* "WAVE" */
read_32bitBE(0xCC,streamFile) != 0x666D7420 || /* "fmt\0x20" */
read_32bitBE(0x10,streamFile) != 0x12000000 || /* "0x12000000" */
read_16bitBE(0x14,streamFile) != (int16_t)0xFEFF) /* "FEFF" */
goto fail;
loop_flag = 1;