summaryrefslogtreecommitdiff
path: root/graphics/dia/patches/0006-Bug-676830-Misc-Grid-don-t-crash-on-copy-resize.patch
blob: 482c8a7b5977c121a166ce0d40890b662477514a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From b9b279e8bd77e0fb27176d64baa75563054ac5e1 Mon Sep 17 00:00:00 2001
From: Hans Breuer <hans@breuer.org>
Date: Sat, 23 Jun 2012 15:21:58 +0200
Subject: [PATCH 06/24] Bug 676830 : Misc - Grid : don't crash on copy, resize

Row index was iterated with the columns range.
---
 objects/Misc/grid_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/objects/Misc/grid_object.c b/objects/Misc/grid_object.c
index bf6537a..05d1b16 100644
--- a/objects/Misc/grid_object.c
+++ b/objects/Misc/grid_object.c
@@ -479,7 +479,7 @@ grid_object_reallocate_cells (Grid_Object* grid_object)
 
   /* implicit: if (new_cols < old_cols) */
   for (i = new_cols; i < old_cols; ++i)
-    for (j = 0; j < old_cols && j < new_cols; ++j) /* don't double-delete */
+    for (j = 0; j < old_rows && j < new_rows; ++j) /* don't double-delete */
     {
       int cell = grid_cell(i, j, old_rows, old_cols);
       object_remove_connections_to(&grid_object->cells[cell]);
-- 
1.8.4.4