src/wavlike.c: Fix wavlike_subchunk_parse skipping of erroneous subchunks, closes #374

Drop invalid +4 as in 65eabcbf7.
This commit is contained in:
Mads Kiilerich 2022-10-26 13:07:11 +02:00 committed by evpobr
parent cc5be43f09
commit bc2e8bebe4
2 changed files with 3 additions and 5 deletions

View File

@ -1089,7 +1089,7 @@ wavlike_subchunk_parse (SF_PRIVATE *psf, int chunk, uint32_t chunk_length)
chunk_size += (chunk_size & 1) ;
psf_log_printf (psf, " *** %M : %u\n", chunk, chunk_size) ;
if (bytesread + chunk_size > chunk_length)
{ bytesread += psf_binheader_readf (psf, "j", chunk_length - bytesread + 4) ;
{ bytesread += psf_binheader_readf (psf, "j", chunk_length - bytesread) ;
continue ;
}
else

View File

@ -199,17 +199,15 @@ wav_list_recover_test (const char * filename)
memset (&sfinfo, 0, sizeof (sfinfo)) ;
sndfile = sf_open (filename, SFM_READ, &sfinfo) ;
if (sndfile)
{ printf ("\n\nLine %d : expected failure - issue 374 reports no recovery from bogus LIST content.\n", __LINE__) ;
if (!sndfile)
{ printf ("\n\nLine %d : expected recovery from bogus LIST content.\n", __LINE__) ;
exit (1) ;
} ;
/*
if (sfinfo.frames != 2)
{ printf ("\n\nLine %d : Should have read data chunk with 2 stereo frames, got %ld.\n\n", __LINE__, (long)sfinfo.frames) ;
exit (1) ;
} ;
*/
unlink (filename) ;
puts ("ok") ;