src/ : Exit parser loop when marker == 0.

This commit is contained in:
Erik de Castro Lopo 2012-04-12 19:42:02 +10:00
parent f07fb6e0f6
commit 028458b9f6
3 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,9 @@
Fix regression in handling of odd length SSND chunks.
Thanks Olivier Tristan for the example file.
* src/aiff.c src/wav.c
Exit parser loop when marker == 0.
2012-04-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* doc/FAQ.html

View File

@ -416,6 +416,10 @@ aiff_read_header (SF_PRIVATE *psf, COMM_CHUNK *comm_fmt)
marker = chunk_size = 0 ;
psf_binheader_readf (psf, "Ejm4", jump, &marker, &chunk_size) ;
if (marker == 0)
{ psf_log_printf (psf, "Have 0 marker.\n") ;
break ;
} ;
if (psf->file.mode == SFM_RDWR && (found_chunk & HAVE_SSND))
return SFE_AIFF_RW_SSND_NOT_LAST ;

View File

@ -349,6 +349,10 @@ wav_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock)
marker = chunk_size = 0 ;
psf_binheader_readf (psf, "jm4", jump, &marker, &chunk_size) ;
if (marker == 0)
{ psf_log_printf (psf, "Have 0 marker.\n") ;
break ;
} ;
psf_store_read_chunk_u32 (&psf->rchunks, marker, psf_ftell (psf), chunk_size) ;