From f06efd91d0f0e58c65af0850de98846650187e89 Mon Sep 17 00:00:00 2001 From: fastelbja Date: Sat, 3 May 2008 19:41:28 +0000 Subject: [PATCH] git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@75 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/meta/adx_header.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/meta/adx_header.c b/src/meta/adx_header.c index d7d630f8..3c099244 100644 --- a/src/meta/adx_header.c +++ b/src/meta/adx_header.c @@ -51,14 +51,22 @@ VGMSTREAM * init_vgmstream_adx(const char * const filename) { loop_end_offset = read_32bitBE(0x28,infile); } } else if (version_signature == 0x01F40400) { - header_type = meta_ADX_04; - if (copyright_offset-2 >= 0x38) { /* enough space for loop info? */ + + off_t ainf_info_length=0; + + if((uint32_t)read_32bitBE(0x24,infile)==0x41494E46) /* AINF Header */ + ainf_info_length = (off_t)read_32bitBE(0x28,infile); + + header_type = meta_ADX_04; + if (copyright_offset-ainf_info_length-2 >= 0x38) { /* enough space for loop info? */ loop_flag = (read_32bitBE(0x24,infile) != 0); loop_start_sample = read_32bitBE(0x28,infile); loop_start_offset = read_32bitBE(0x2c,infile); loop_end_sample = read_32bitBE(0x30,infile); loop_end_offset = read_32bitBE(0x34,infile); } + } else if (version_signature == 0x01F40500) { /* found in some SFD : Buggy Heat */ + header_type = meta_ADX_05; } else goto fail; /* not a known/supported version signature */ /* At this point we almost certainly have an ADX file,