diff --git a/src/stratifier.c b/src/stratifier.c index 0a2c2d34..d0e8b375 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -879,6 +879,11 @@ static void update_diff(ckpool_t *ckp) json_dblcpy(&diff, val, "diff"); json_decref(val); + /* We only really care about integer diffs so clamp the lower limit to + * 1 or it will round down to zero. */ + if (unlikely(diff < 1)) + diff = 1; + ck_wlock(&workbase_lock); old_diff = proxy_base.diff; current_workbase->diff = proxy_base.diff = diff;