[evolution/gnome-3-36] I#915 - Fix some issues reported by Clang's ubsan sanitizer



commit 713a7a8f184849e97b4918f8ffcda3a04710ebf7
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 12 18:22:23 2020 +0200

    I#915 - Fix some issues reported by Clang's ubsan sanitizer
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/915

 src/calendar/gui/e-week-view-titles-item.c | 4 ++--
 src/e-util/e-canvas-background.c           | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/calendar/gui/e-week-view-titles-item.c b/src/calendar/gui/e-week-view-titles-item.c
index 24f4f9eba7..10efab2707 100644
--- a/src/calendar/gui/e-week-view-titles-item.c
+++ b/src/calendar/gui/e-week-view-titles-item.c
@@ -199,9 +199,9 @@ week_view_titles_item_draw (GnomeCanvasItem *canvas_item,
                                + week_view->slash_width
                                + week_view->abbr_day_widths[6];
                else if (abbreviated)
-                       date_width = week_view->abbr_day_widths[weekday];
+                       date_width = week_view->abbr_day_widths[weekday - 1];
                else
-                       date_width = week_view->day_widths[weekday];
+                       date_width = week_view->day_widths[weekday - 1];
 
                date_x = week_view->col_offsets[col]
                        + (week_view->col_widths[col] - date_width) / 2;
diff --git a/src/e-util/e-canvas-background.c b/src/e-util/e-canvas-background.c
index 8da675b410..b63d442afa 100644
--- a/src/e-util/e-canvas-background.c
+++ b/src/e-util/e-canvas-background.c
@@ -76,10 +76,10 @@ ecb_bounds (GnomeCanvasItem *item,
             gdouble *x2,
             gdouble *y2)
 {
-       *x1 = -G_MAXDOUBLE;
-       *y1 = -G_MAXDOUBLE;
-       *x2 = G_MAXDOUBLE;
-       *y2 = G_MAXDOUBLE;
+       *x1 = G_MININT;
+       *y1 = G_MININT;
+       *x2 = G_MAXINT;
+       *y2 = G_MAXINT;
 }
 
 static void


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