src/wav.c: Fix skipping of erroneous subchunks

Closes: https://github.com/erikd/libsndfile/issues/370
This commit is contained in:
Johan Vromans 2018-03-14 09:10:14 +01:00 committed by Erik de Castro Lopo
parent a34dc27739
commit 65eabcbf71

View File

@ -963,7 +963,7 @@ wavlike_subchunk_parse (SF_PRIVATE *psf, int chunk, uint32_t chunk_length)
*/
psf_log_printf (psf, " *** Found weird-ass zero marker. Jumping to end of chunk.\n") ;
if (bytesread < chunk_length)
bytesread += psf_binheader_readf (psf, "j", chunk_length - bytesread + 4) ;
bytesread += psf_binheader_readf (psf, "j", chunk_length - bytesread) ;
psf_log_printf (psf, " *** Offset is now : 0x%X\n", psf_fseek (psf, 0, SEEK_CUR)) ;
return 0 ;