src/w64.c : Fix writing of 'riff' chunk length and check for correct value in parser.

This commit is contained in:
Erik de Castro Lopo 2007-10-10 14:04:02 +10:00
parent d4ef5e4320
commit a516149c22
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-10-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/w64.c
Fix writing of 'riff' chunk length and check for correct value in parser.
2007-09-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* doc/index.html

View File

@ -226,7 +226,7 @@ w64_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock)
bytesread += psf_binheader_readf (psf, "e8", &chunk_size) ;
if (psf->filelength < chunk_size)
if (psf->filelength != chunk_size)
psf_log_printf (psf, "riff : %D (should be %D)\n", chunk_size, psf->filelength) ;
else
psf_log_printf (psf, "riff : %D\n", chunk_size) ;
@ -399,7 +399,7 @@ w64_write_header (SF_PRIVATE *psf, int calc_length)
psf_fseek (psf, 0, SEEK_SET) ;
/* riff marker, length, wave and 'fmt ' markers. */
psf_binheader_writef (psf, "eh8hh", riff_MARKER16, psf->filelength - 8, wave_MARKER16, fmt_MARKER16) ;
psf_binheader_writef (psf, "eh8hh", riff_MARKER16, psf->filelength, wave_MARKER16, fmt_MARKER16) ;
subformat = psf->sf.format & SF_FORMAT_SUBMASK ;