From 53e80684d1c06b9e52bfb1b1fc8b75a5caec3e08 Mon Sep 17 00:00:00 2001 From: manakoAT Date: Sat, 22 Nov 2008 21:29:16 +0000 Subject: [PATCH] nds strm fixed git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@483 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/meta/nds_strm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/meta/nds_strm.c b/src/meta/nds_strm.c index cfc60ea3..b13c2bf7 100644 --- a/src/meta/nds_strm.c +++ b/src/meta/nds_strm.c @@ -18,9 +18,13 @@ VGMSTREAM * init_vgmstream_nds_strm(STREAMFILE *streamFile) { if (strcasecmp("strm",filename_extension(filename))) goto fail; /* check header */ - if ((uint32_t)read_32bitBE(0,streamFile)!=0x5354524D || - (uint32_t)read_32bitBE(4,streamFile)!=0xFFFE0001) - goto fail; + if ((uint32_t)read_32bitBE(0x00,streamFile)!=0x5354524D) /* STRM */ + 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 */ + goto fail; + } + /* check for HEAD section */ if ((uint32_t)read_32bitBE(0x10,streamFile)!=0x48454144 || /* "HEAD" */