diff --git a/src/flow-manager.c b/src/flow-manager.c index 1b07674996..c6d2117d43 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -800,7 +800,9 @@ static void GetWorkUnitSizing(const uint32_t rows, const uint32_t mp, const bool } /* minimum busy score is 10 */ const uint32_t emp = MAX(mp, 10); - const uint32_t rows_per_sec = (uint32_t)((float)rows * (float)((float)emp / (float)100)); + /* ensure minimum rows_per_sec is at least 1 */ + const uint32_t rows_per_sec = + MAX(1, (uint32_t)((float)rows * (float)((float)emp / (float)100))); /* calc how much time we estimate the work will take, in ms. We assume * each row takes an average of 1usec. Maxing out at 1sec. */ const uint32_t work_per_unit = MIN(rows_per_sec / 1000, 1000);