Fix problems with WAV files containing large chunks after the 'data' chunk.

This commit is contained in:
Erik de Castro Lopo 2004-03-19 09:15:01 +00:00
parent 5b3240595f
commit e3111a2694
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2004-03-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/common.c
Fix problems with WAV files containing large chunks after the 'data'
chunk. Thanks to Koen Tanghe for providing a sample file.
2004-03-17 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* configure.ac

View File

@ -3,7 +3,7 @@
dnl Require autoconf version
AC_PREREQ(2.53)
AC_INIT(libsndfile,1.0.9pre1,erikd@mega-nerd.com)
AC_INIT(libsndfile,1.0.9pre2,erikd@mega-nerd.com)
AC_CONFIG_SRCDIR([src/sndfile.c])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)

View File

@ -770,9 +770,14 @@ header_seek (SF_PRIVATE *psf, sf_count_t position, int whence)
break ;
case SEEK_CUR :
if (psf->headindex + position < 0 || psf->headindex >= SIGNED_SIZEOF (psf->header))
if (psf->headindex + position < 0)
break ;
if (psf->headindex >= SIGNED_SIZEOF (psf->header))
{ psf_fseek (psf, position, whence) ;
return ;
} ;
if (psf->headindex + position <= psf->headend)
{ psf->headindex += position ;
break ;