gsk: Add an assertion to help static analysis
authorMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 05:02:20 +0000 (00:02 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2022 05:04:23 +0000 (00:04 -0500)
clang gets wild ideas about negative radii otherwise.

gsk/gskrendernodeimpl.c

index 286269ec15aaa55252f264a906361a09ddce7f97..a797bafb4940d8b80d9d1a088c684aaafc46a0d5 100644 (file)
@@ -4818,6 +4818,8 @@ blur_image_surface (cairo_surface_t *surface, int radius, int iterations)
   cairo_surface_t *tmp;
   int width, height;
 
+  g_assert (radius >= 0);
+
   width = cairo_image_surface_get_width (surface);
   height = cairo_image_surface_get_height (surface);
   tmp = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);