Blame SOURCES/gtk-3.22.20-avoid-cellarea-crash.patch

dca6ef
From 4ba89f25b8a88616afc1915bdb4fb87d13efae6f Mon Sep 17 00:00:00 2001
dca6ef
From: Benjamin Otte <otte@redhat.com>
dca6ef
Date: Tue, 15 Jun 2021 19:34:37 +0200
dca6ef
Subject: [PATCH] cellarea: Don't shrink area too much
dca6ef
dca6ef
Do not compute rectangles with negative width/height. This avoids
dca6ef
assertion failures further down when those rectangles were actually
dca6ef
checked.
dca6ef
dca6ef
https://bugzilla.redhat.com/show_bug.cgi?id=1962215
dca6ef
---
dca6ef
 gtk/gtkcellarea.c | 10 ++++++++++
dca6ef
 1 file changed, 10 insertions(+)
dca6ef
dca6ef
diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c
dca6ef
index 575e1c7fde..d1b3b1a279 100644
dca6ef
--- a/gtk/gtkcellarea.c
dca6ef
+++ b/gtk/gtkcellarea.c
dca6ef
@@ -3563,8 +3563,18 @@ gtk_cell_area_inner_cell_area (GtkCellArea        *area,
dca6ef
 
dca6ef
   *inner_area = *cell_area;
dca6ef
 
dca6ef
+  if (border.left + border.right > cell_area->width)
dca6ef
+    {
dca6ef
+      border.left = cell_area->width / 2;
dca6ef
+      border.right = (cell_area->width + 1) / 2;
dca6ef
+    }
dca6ef
   inner_area->x += border.left;
dca6ef
   inner_area->width -= border.left + border.right;
dca6ef
+  if (border.top + border.bottom > cell_area->height)
dca6ef
+    {
dca6ef
+      border.top = cell_area->height / 2;
dca6ef
+      border.bottom = (cell_area->height + 1) / 2;
dca6ef
+    }
dca6ef
   inner_area->y += border.top;
dca6ef
   inner_area->height -= border.top + border.bottom;
dca6ef
 }
dca6ef
-- 
dca6ef
GitLab
dca6ef