[libshumate/wip/mlundblad/mult-conversion-fixes: 2/2] test-tile-source: Avoid int mulitplication overflow




commit 984714dde67d920d53e428104d40eda93e35814a
Author: Marcus Lundblad <ml update uu se>
Date:   Fri Nov 12 23:28:04 2021 +0100

    test-tile-source: Avoid int mulitplication overflow
    
    Avoid int * int multiplication warnings by performing
    the calculation on gsize values.

 demos/shumate-test-tile-source.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/demos/shumate-test-tile-source.c b/demos/shumate-test-tile-source.c
index 5d479ba..c9ce238 100644
--- a/demos/shumate-test-tile-source.c
+++ b/demos/shumate-test-tile-source.c
@@ -47,8 +47,8 @@ texture_new_for_surface (cairo_surface_t *surface)
   g_return_val_if_fail (cairo_image_surface_get_height (surface) > 0, NULL);
 
   bytes = g_bytes_new_with_free_func (cairo_image_surface_get_data (surface),
-                                      cairo_image_surface_get_height (surface)
-                                      * cairo_image_surface_get_stride (surface),
+                                      (gsize) cairo_image_surface_get_height (surface)
+                                      * (gsize) cairo_image_surface_get_stride (surface),
                                       (GDestroyNotify) cairo_surface_destroy,
                                       cairo_surface_reference (surface));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]