mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-26 19:40:24 +00:00
src/wavlike.c: Fix wavlike_subchunk_parse skipping of erroneous subchunks, closes #374
Drop invalid +4 as in 65eabcbf7
.
This commit is contained in:
parent
cc5be43f09
commit
bc2e8bebe4
@ -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
|
||||
|
@ -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") ;
|
||||
|
Loading…
Reference in New Issue
Block a user