src/wav.c : Handle four zero bytes as a marker within a LIST or INFO chunk. Thanks to Rogrio Brito for supplying an example file.

This commit is contained in:
Erik de Castro Lopo 2009-02-15 19:31:07 +11:00
parent b038515b4e
commit 6ab21f7671
2 changed files with 15 additions and 0 deletions

View File

@ -5,6 +5,10 @@
around problems that might occur if a users TERM settings are incorrect.
Thanks to Rob Til Freedmen for helping to debug this.
* src/wav.c
Handle four zero bytes as a marker within a LIST or INFO chunk.
Thanks to Rogério Brito for supplying an example file.
2009-02-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/common.h src/*.c

View File

@ -1380,6 +1380,17 @@ wav_subchunk_parse (SF_PRIVATE *psf, int chunk)
bytesread += exif_subchunk_parse (psf, length - bytesread) ;
break ;
case 0 :
/*
** Four zero bytes where a marker was expected. Assume this means
** the rest of the chunk is garbage.
*/
psf_log_printf (psf, " *** Found weird-ass zero marker. Jumping to end of chunk.\n") ;
if (bytesread < length)
bytesread += psf_binheader_readf (psf, "j", length - bytesread + 4) ;
psf_log_printf (psf, " *** Offset is now : 0x%X\n", psf_fseek (psf, 0, SEEK_CUR)) ;
return 0 ;
default :
psf_binheader_readf (psf, "4", &dword) ;
bytesread += sizeof (dword) ;