mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-29 19:37:30 +01:00
a few 16-bit reads should have been unsigned
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@47 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
9275738da2
commit
8896b396a7
@ -30,7 +30,7 @@ VGMSTREAM * init_vgmstream_adx(const char * const filename) {
|
||||
if ((uint16_t)read_16bitBE(0,infile)!=0x8000) goto fail;
|
||||
|
||||
/* get copyright/stream offset, check */
|
||||
copyright_offset = read_16bitBE(2,infile);
|
||||
copyright_offset = (uint16_t)read_16bitBE(2,infile);
|
||||
if ((uint32_t)read_32bitBE(copyright_offset,infile)!=0x29435249 || /* ")CRI" */
|
||||
(uint16_t)read_16bitBE(copyright_offset-2,infile)!=0x2863) /* "(c" */
|
||||
goto fail;
|
||||
|
@ -27,7 +27,7 @@ VGMSTREAM * init_vgmstream_afc(const char * const filename) {
|
||||
|
||||
/* fill in the vital statistics */
|
||||
vgmstream->num_samples = read_32bitBE(0x04,infile);
|
||||
vgmstream->sample_rate = read_16bitBE(0x08,infile);
|
||||
vgmstream->sample_rate = (uint16_t)read_16bitBE(0x08,infile);
|
||||
/* channels and loop flag are set by allocate_vgmstream */
|
||||
vgmstream->loop_start_sample = read_32bitBE(0x14,infile);
|
||||
vgmstream->loop_end_sample = vgmstream->num_samples;
|
||||
|
@ -37,7 +37,7 @@ VGMSTREAM * init_vgmstream_agsc(const char * const filename) {
|
||||
|
||||
/* fill in the vital statistics */
|
||||
vgmstream->num_samples = read_32bitBE(header_offset+0xda,infile);
|
||||
vgmstream->sample_rate = read_16bitBE(header_offset+0xd8,infile);
|
||||
vgmstream->sample_rate = (uint16_t)read_16bitBE(header_offset+0xd8,infile);
|
||||
|
||||
vgmstream->loop_start_sample = read_32bitBE(header_offset+0xde,infile);
|
||||
/* this is cute, we actually have a "loop length" */
|
||||
|
@ -62,7 +62,7 @@ VGMSTREAM * init_vgmstream_brstm(const char * const filename) {
|
||||
|
||||
/* fill in the vital statistics */
|
||||
vgmstream->num_samples = read_32bitBE(head_offset+0x2c,infile);
|
||||
vgmstream->sample_rate = read_16bitBE(head_offset+0x24,infile);
|
||||
vgmstream->sample_rate = (uint16_t)read_16bitBE(head_offset+0x24,infile);
|
||||
/* channels and loop flag are set by allocate_vgmstream */
|
||||
vgmstream->loop_start_sample = read_32bitBE(head_offset+0x28,infile);
|
||||
vgmstream->loop_end_sample = vgmstream->num_samples;
|
||||
|
Loading…
x
Reference in New Issue
Block a user