Commit Graph

55 Commits

Author SHA1 Message Date
Martijn van Beurden c227be6c12 Add multithreading to libFLAC++ and more fuzzers 2023-09-22 21:10:15 +02:00
Martijn van Beurden c29735769c Add multithreaded fuzzing to fuzzer_encoder_v2 2023-09-22 21:10:15 +02:00
Martijn van Beurden 2a3f1efebc Mute output of fuzzer_encoder_v2 2023-09-22 21:10:15 +02:00
Martijn van Beurden e00d9b881f
Update copyright year and maintainer status 2023-06-06 22:08:24 +02:00
Martijn van Beurden d6974b9702
Remove sector align option
This option has been deprecated since FLAC 1.3.0.
2023-05-31 21:49:44 +02:00
Martijn van Beurden 890912644a Add seed corpus files for fuzzer_tool_flac 2023-05-20 07:29:04 +02:00
Martijn van Beurden ec4e5aa95d Add flac tool fuzzer dictionary 2023-04-28 23:08:58 +02:00
Martijn van Beurden eed37c39fa Enable fuzzer_tool_metaflac to fuzz with stdin 2023-03-19 18:31:16 +01:00
Martijn van Beurden ac39a0078d Improve fuzzer_tool_metaflac 2023-03-19 18:31:16 +01:00
Martijn van Beurden 67d2e1ee4c Add fuzzer for metaflac command-line tool 2023-03-19 18:31:16 +01:00
Martijn van Beurden e683286bb4 Add use of stdin to fuzzer_tool_flac, and redirect stdout 2023-03-18 22:55:35 +01:00
Martijn van Beurden 9593b949c2 Try to unblock fuzzer_tool_flac by resetting global variables 2023-03-18 22:55:35 +01:00
Martijn van Beurden 383512d551 Try to make tool_flac fuzzer not only fuzz with arguments 2023-03-09 14:31:49 +01:00
Martijn van Beurden 67a0a153ca Fix oss-build problem and add fuzzer_tool_flac to .gitignore 2023-02-23 06:59:11 +01:00
Martijn van Beurden 21ffc935f0 Add fuzzer for flac command-line tool
Up until now, only libFLAC was being fuzzed. This commit adds a
fuzzer capable of fuzzing most code of the flac executable
2023-02-22 03:18:20 +01:00
Martijn van Beurden 8daf62da0c Rename fuzzer source files to simplify oss-fuzz build script 2023-02-21 15:56:40 +01:00
Martijn van Beurden 5663f11795
Check number of metadata blocks
Fixes out-of-bounds access

Credit: Oss-Fuzz
2022-11-16 20:16:26 +01:00
Martijn van Beurden 59195461b6 Add fuzzer_reencoder 2022-11-15 22:06:41 +01:00
Martijn van Beurden 9e3d1666c1 Add subdivide_tukey to encoder fuzzer dictionary 2022-11-13 22:41:18 +01:00
Martijn van Beurden 76e8f22b4c Clean up and add to fuzzer_encoder (v1)
Now fuzzer_encoder_v2 has been running for quite some time and no
big (encoder) projects are coming, fuzzer_encoder is changed. This
will invalidate the current corpus which will take time to rebuild,
but I think this is a good moment to do so.
2022-11-13 22:41:18 +01:00
Martijn van Beurden e91bbb4e28 Add FLAC__stream_encoder_set_limit_min_bitrate to fuzzer_encoder_v2 2022-11-13 22:41:18 +01:00
Martijn van Beurden 1d3d5d98b6
Improve fuzzer_encoder_v2 coverage: add picture and unkown metadata 2022-11-11 21:36:32 +01:00
Martijn van Beurden a7b22e9edb
Improve fuzzer_encoder_v2 coverage: add cuesheet 2022-11-11 07:05:31 +01:00
Martijn van Beurden 96b5e6d35a Check vorbis comment entry before copying
Whereas in C vorbis comment fields are in an array, C++ actually
validates the comment before returning it. This means it needs a
little more checking.
2022-11-09 07:19:31 +01:00
Martijn van Beurden abdcb80bf8 Add checks for simple iterator status 2022-11-09 07:19:31 +01:00
Martijn van Beurden f64f3782f0
Only fuzz apodizations on small inputs (#479) 2022-10-12 16:58:03 +02:00
Martijn van Beurden 09660e58dd
Reduce timeouts of fuzzer_encoder similar to fuzzer_encoder_v2 2022-10-11 07:24:47 +02:00
Martijn van Beurden 5d1402eae3
fuzzer: Do not add corrupt vorbiscomment metadata block
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50509
Credit: Oss-Fuzz
2022-08-31 07:10:20 +02:00
Martijn van Beurden 5bc582b2c7 Fix some OOM metadata bugs, disable OOM checking in metadata fuzzing
For now OOM emulation in fuzzer_metadata is disabled, as I really
want to get as much merged as soon as possible. Need to get back
to this at some point
2022-08-20 16:03:53 +02:00
Martijn van Beurden 1f21ae2702 Add write callback abort check to seeking fuzzer
If the write callback calls for an abort, this must be honored.
This commit adds a check to ascertain the write callback isn't
called again
2022-08-20 16:03:53 +02:00
Martijn van Beurden c65483e2c2 Do not memset when allocation fails
Also remove some nearby unused code
2022-08-20 16:03:53 +02:00
Martijn van Beurden fbb6cb5c07 Add OOM checking to fuzzing 2022-08-20 16:03:53 +02:00
Martijn van Beurden 6d2492d346
Prepare oom checking in fuzzing
By merging oom checking in fuzzing in steps, it is possible to
implement it without having oss-fuzz build failures
2022-08-19 11:59:16 +02:00
Martijn van Beurden 6a9d952f6c Check for vorbis comment entry being not null in fuzzer 2022-07-28 17:44:24 +02:00
Martijn van Beurden d3b8947b73 Improve tempfile generation of fuzzer_metadata 2022-07-16 21:11:16 +02:00
Martijn van Beurden 77521a7d67 Eliminate race conditions in fuzzer_metadata file access
See https://github.com/google/oss-fuzz/issues/8006 for details
2022-07-15 07:46:26 +02:00
Martijn van Beurden da7b9a0ced Add fuzzer_metadata 2022-07-07 22:06:14 +02:00
Martijn van Beurden 81c973fa1c Add new decoder fuzzer, mostly to cover seeking
This second decoder fuzzer dumps the fuzz input to a file, which enables
testing of seeking code
2022-06-15 07:46:48 +02:00
Martijn van Beurden 73cb63a0e5 Add stats to encoder fuzzer on verify failure 2022-06-12 18:38:21 +02:00
Martijn van Beurden 9b3826006a Change fuzzer_encoder_v2 timeout prevention 2022-06-11 22:44:16 +02:00
Martijn van Beurden 3528fa292a Check found metadata in decoder fuzzer
This greatly improves code coverage
2022-06-10 21:58:24 +02:00
Martijn van Beurden 5705a61c55 fuzzer_encoder_v2, fix 32-bit input and seektable 2022-05-26 22:46:09 +02:00
Martijn van Beurden 74b093f6e1 Fix initialization of encoder fuzzer (v1)
The encoder fuzzer initialized before setting up. This is now swapped
without upsetting the way the datasource is queried
2022-05-19 20:22:09 +02:00
Martijn van Beurden 383b77fa08 Let fuzzer_encoder_v2 use tmp files to improve coverage 2022-05-19 20:22:09 +02:00
Martijn van Beurden 9e8d7389dc Fix initialization of decoder fuzzer
The decoder fuzzer initialized before setting up. This is now swapped
without upsetting the way the datasource is queried
2022-05-18 17:12:28 +02:00
Martijn van Beurden becba351f0 Make it possible for fuzzer to disable instruction set optimizations
This should greatly increase code coverage of the encoder fuzzer
2022-05-11 10:34:49 +02:00
Martijn van Beurden 87a5f3e952 Add abort on encoding error that should not happen
This commit lets the following errors trigger an abort:
- FLAC__STREAM_ENCODER_OGG_ERROR
- FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR
- FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA
- FLAC__STREAM_ENCODER_IO_ERROR
- FLAC__STREAM_ENCODER_FRAMING_ERROR
- FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR

FLAC__STREAM_ENCODER_CLIENT_ERROR does not trigger an abort because
it is used to signal invalid input. FLAC__STREAM_ENCODER_UNINITIALIZED
does not trigger an abort because init fails when invalid parameters
are given
2022-05-11 10:34:49 +02:00
Martijn van Beurden b64ea1171b Fix fuzzer_encoder_v2 timeouts
This fixes the 'false positive' oss-fuzz bug filed under
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47264

The fuzzer was timing out because of an enormous input (932kB)
combined with very slow settings. The commit disables certain
slow settings on inputs larger than 2^18 byte.
2022-05-07 21:58:40 +02:00
Martijn van Beurden b6e2f4f014 Fix distcheck 2022-05-06 12:28:17 +02:00
Martijn van Beurden b52734242e Add fuzzer_encoder_v2
Add additional fuzzer for the encoder, aiming to reach more coverage
than the current encoder fuzzer. This is done by incorporating
metadata handling and fixing a problem with different settings in
the current fuzzer
2022-04-30 21:20:50 +02:00