summaryrefslogtreecommitdiff
path: root/src/libFLAC
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-05-10 20:10:42 +0200
committerMartijn van Beurden <mvanb1@gmail.com>2022-05-28 07:31:37 +0200
commit9e143766ca7e9eae7bd412e48d2d9d222646ad52 (patch)
tree6ab1361ded01cc421a5f05c06dbd6407bc628414 /src/libFLAC
parent6b2fc739ed7c136dab25d75376175f0dc47d6713 (diff)
downloadflac-9e143766ca7e9eae7bd412e48d2d9d222646ad52.tar.gz
Only locally disable signed integer sanitizing on decoder fuzzers
See https://github.com/google/oss-fuzz/pull/7687
Diffstat (limited to 'src/libFLAC')
-rw-r--r--src/libFLAC/fixed.c2
-rw-r--r--src/libFLAC/lpc.c3
-rw-r--r--src/libFLAC/stream_decoder.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/libFLAC/fixed.c b/src/libFLAC/fixed.c
index 9e53f299..dcb71c53 100644
--- a/src/libFLAC/fixed.c
+++ b/src/libFLAC/fixed.c
@@ -375,7 +375,7 @@ void FLAC__fixed_compute_residual(const FLAC__int32 data[], uint32_t data_len, u
}
}
-#if defined(__clang__)
+#ifdef FUZZING_BUILD_MODE_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
* Because fuzzing feeds bogus predictors and residual samples to the
* decoder, having overflows in this section is unavoidable. Also,
diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c
index ba3ae272..b2545ad5 100644
--- a/src/libFLAC/lpc.c
+++ b/src/libFLAC/lpc.c
@@ -807,7 +807,8 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */
-#if defined(__clang__)
+
+#ifdef FUZZING_BUILD_MODE_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
* Because fuzzing feeds bogus predictors and residual samples to the
* decoder, having overflows in this section is unavoidable. Also,
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index b6def9c9..c12dfae1 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -2986,7 +2986,7 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data)
*/
}
-#if defined(__clang__)
+#ifdef FUZZING_BUILD_MODE_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
* Because fuzzing feeds bogus predictors and residual samples to the
* decoder, having overflows in this section is unavoidable. Also,