aboutsummaryrefslogtreecommitdiffhomepage
path: root/fuzz/Fuzz.h
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2016-11-29 11:25:52 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-29 18:29:03 +0000
commitd1042662413b61f138e621b60818e41b5d916bde (patch)
tree124deb04885da21804f82fade90dc7a96c4b2e87 /fuzz/Fuzz.h
parentdf96319f359ed38b42d49ddd3e9f7e5b06df9db0 (diff)
Fix fuzzRange
Make the fuzzRange not crash if min == max, just set n to be min. BUG=skia: Change-Id: I138cefbec9b408d3b35e4258d770e6b396af0e5f Reviewed-on: https://skia-review.googlesource.com/5305 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'fuzz/Fuzz.h')
-rw-r--r--fuzz/Fuzz.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/fuzz/Fuzz.h b/fuzz/Fuzz.h
index 8abbb2276a..800a9f1a83 100644
--- a/fuzz/Fuzz.h
+++ b/fuzz/Fuzz.h
@@ -95,7 +95,11 @@ inline void Fuzz::nextRange(float* f, float min, float max) {
template <typename T, typename Min, typename Max>
inline void Fuzz::nextRange(T* n, Min min, Max max) {
this->next<T>(n);
- if (min >= max) {
+ if (min == max) {
+ *n = min;
+ return;
+ }
+ if (min > max) {
// Avoid misuse of nextRange
this->signalBug();
}