aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Thomas Orgis <ich@sobukus.de>2019-07-31 21:57:00 +0200
committerGravatar jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2019-07-31 12:57:00 -0700
commit0a100f4c1c1484752423ec538a26533eef5b5d24 (patch)
tree65c38351b4a47411000d3081dd56e004d2f11cec
parent6c0fcaf1b2d9d016b89799ca54b8520aa488b27f (diff)
[mpg123] silence library error messages (#2642)
* mpg123/read_fuzzer: disable error messages from libmpg123 This shall remove any error messages libmpg123 prints out during fuzzing, leaving only the crash trace at the inevitable end.
-rw-r--r--projects/mpg123/decode_fuzzer.cc4
-rw-r--r--projects/mpg123/read_fuzzer.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/projects/mpg123/decode_fuzzer.cc b/projects/mpg123/decode_fuzzer.cc
index 56006be9..0f0e662f 100644
--- a/projects/mpg123/decode_fuzzer.cc
+++ b/projects/mpg123/decode_fuzzer.cc
@@ -19,7 +19,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
}
- ret = mpg123_open_feed(handle);
+ ret = mpg123_param(handle, MPG123_ADD_FLAGS, MPG123_QUIET, 0.);
+ if(ret == MPG123_OK)
+ ret = mpg123_open_feed(handle);
if (ret != MPG123_OK) {
mpg123_delete(handle);
return 0;
diff --git a/projects/mpg123/read_fuzzer.c b/projects/mpg123/read_fuzzer.c
index f6587160..75e9275c 100644
--- a/projects/mpg123/read_fuzzer.c
+++ b/projects/mpg123/read_fuzzer.c
@@ -63,7 +63,8 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
int error;
mpg123_handle* handle = mpg123_new(NULL, &error);
- if (handle == NULL) {
+ if (handle == NULL || mpg123_param(handle,
+ MPG123_ADD_FLAGS, MPG123_QUIET, 0.) != MPG123_OK) {
free(outmemory);
fuzzer_release_tmpfile(filename);
return 0;