[libshumate] vector-style: Avoid int multiplication overflow



commit f1ac284983dcede17f47949d34da20f025bb8298
Author: Andy Holmes <andrew g r holmes gmail com>
Date:   Tue Nov 16 22:39:59 2021 -0800

    vector-style: Avoid int multiplication overflow
    
    Avoid int * int multiplication warnings by performing
    the calculation on gsize values.

 shumate/shumate-vector-style.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/shumate/shumate-vector-style.c b/shumate/shumate-vector-style.c
index 600f4a6..d36c4dc 100644
--- a/shumate/shumate-vector-style.c
+++ b/shumate/shumate-vector-style.c
@@ -265,8 +265,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]