33d19ae9a5
When skipping a comment, the total number of expected comments goes down. But it should not fall below zero. This issue was benign: in the case of wraparound, we would still read to the end of the block as usual, and no further. The 'comments_len' variable was only used after that to report a format error in case of a mismatch between how many comments we read, and how many the header said there would be. The preallocation for the comments vector has already happened at that point, so this could not cause a large allocation. This issue was caught on CI by LibFuzzer. |
||
---|---|---|
.. | ||
extra | ||
fuzz | ||
empty_vorbis_comment.flac | ||
large_vendor_string.flac | ||
large_vorbis_comment_block.flac | ||
non_subset.flac | ||
pop.flac | ||
populate.sh | ||
readme.md | ||
repeated_vorbis_comment.flac | ||
short.flac | ||
wasted_bits.flac |
readme.md
Test samples
For convenience, but mainly for automated testing, the script populate.sh will download five audio files from archive.org (about 126 MiB total). No copyright or trademark infringement is intended in downloading these works. The files comprise several sample rates, bit depths, and channel counts. Some of them contain metadata. Let’s hope that these files are a representative sample of real-world FLAC files.
The populated test files are hard-coded in the tests so they can run in parallel, and provide better feedback.
Extra test samples
You can put (or symlink) FLAC files in the "extra" directory, and the tests will be run on all files in that directory. This allows the decoder to be tested on thousands of files, which is at least an indication that it is correct. The benchmark script will also use these files for benchmarking.
For the tests, directories are traversed recursively and symlinks are followed.
This means you can make a symlink to your music collection in the "extra"
directory, and the decoder will be verified against all the files in the
collection. You probably want to run cargo test
with --release
in that case.
Fuzz crashes
The fuzz directory contains small files generated by a fuzzer that triggered various crashes in the library. These issues have all been resolved since, and the files are kept to prevent regressions.