fix channels count on vag

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@343 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
fastelbja 2008-07-18 21:42:35 +00:00
parent c6a721f5dd
commit 4554044dc9

View File

@ -55,7 +55,7 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) {
if(read_32bitBE(0x20,streamFile)==0x53746572) // vag Stereo
channel_count=2;
case 'p':
if(read_32bitBE(0x04,streamFile)<=0x00000004) {
if((read_32bitBE(0x04,streamFile)<=0x00000004) && (read_32bitBE(0x0c,streamFile)<(get_streamfile_size(streamFile)/2))) {
loop_flag=(read_32bitBE(0x14,streamFile)!=0);
channel_count=2;
} else {
@ -116,7 +116,7 @@ VGMSTREAM * init_vgmstream_ps2_vag(STREAMFILE *streamFile) {
vgmstream->sample_rate = read_32bitBE(0x10,streamFile);
interleave=0x10; // used for loop calc
if(read_32bitBE(0x04,streamFile)==0x00000004) {
if((read_32bitBE(0x04,streamFile)==0x00000004) && (read_32bitBE(0x0c,streamFile)<(get_streamfile_size(streamFile)/2))) {
vgmstream->channels=2;
vgmstream->num_samples = read_32bitBE(0x0C,streamFile);