From 44e660203bcbab509b0ad08b0038192ec471a8de Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 18 Dec 2025 12:30:25 +0200 Subject: testpat: Fix div by zero cppcheck warning --- kms++util/src/testpat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp index 8444ce0..fe0988e 100644 --- a/kms++util/src/testpat.cpp +++ b/kms++util/src/testpat.cpp @@ -476,7 +476,7 @@ void draw_test_pattern_multi(IFramebuffer& fb, const TestPatternOptions& options for (size_t p = 0; p < info.num_planes; ++p) v_sub = max(v_sub, info.planes[p].vsub); - if (fb.height() % v_sub) + if (!v_sub || fb.height() % v_sub) throw invalid_argument("FB height must be divisible with vsub"); // Create the mmaps before starting the threads -- cgit v1.2.3