claxon/testsamples
Ruud van Asseldonk 33d19ae9a5 Fix integer underflow when reading Vorbis comments
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.
2019-09-16 20:26:42 +02:00
..
extra Clean up benchmarking scripts 2017-02-07 13:42:52 +01:00
fuzz Fix integer underflow when reading Vorbis comments 2019-09-16 20:26:42 +02:00
empty_vorbis_comment.flac Add test for empty Vorbis comment 2019-09-11 22:19:10 +02:00
large_vendor_string.flac Guard against malicious Vorbis comment blocks 2017-08-28 22:50:52 +02:00
large_vorbis_comment_block.flac Test that large Vorbis comment blocks are rejected 2017-08-28 22:50:52 +02:00
non_subset.flac Make test sample decodable after surgery 2019-05-11 19:59:45 +02:00
pop.flac add RMS example 2016-05-27 19:35:19 +02:00
populate.sh do not attempt to make populate.sh directory-independent 2016-01-27 10:18:42 +01:00
readme.md Recursively read extra test samples 2017-05-26 19:44:57 +02:00
repeated_vorbis_comment.flac Add tests for FlacReader::get_tag() 2017-08-28 22:50:52 +02:00
short.flac Remove padding from test samples 2017-05-27 22:56:28 +02:00
wasted_bits.flac Remove padding from test samples 2017-05-27 22:56:28 +02:00

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. Lets 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.