From aebdd634eedb23fa0beced5227a308e64ff2c86b Mon Sep 17 00:00:00 2001 From: halleyscometsw Date: Sun, 23 Nov 2008 12:08:33 +0000 Subject: [PATCH] a few fixes for insufficiently strict checks git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@485 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/meta/nds_strm.c | 1 + src/meta/ngc_waa_wac_wad_wam.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/meta/nds_strm.c b/src/meta/nds_strm.c index b13c2bf7..88bf6cde 100644 --- a/src/meta/nds_strm.c +++ b/src/meta/nds_strm.c @@ -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 */ diff --git a/src/meta/ngc_waa_wac_wad_wam.c b/src/meta/ngc_waa_wac_wad_wam.c index 20a948ae..928ff07f 100644 --- a/src/meta/ngc_waa_wac_wad_wam.c +++ b/src/meta/ngc_waa_wac_wad_wam.c @@ -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;