Skip to content

Commit 982030d

Browse files
author
Werner Almesberger
committed
The box coordinates were not properly initialized in gui_draw_pad_text
- gui_inst.c (gui_draw_pad_text): box_min and box_max were initialized to an undefined value, upsetting valgrind and yielding an incorrect location if pad and hole had the same size
1 parent 2a24a95 commit 982030d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

eda/fped/gui_inst.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,11 @@ static void gui_draw_pad_text(struct inst *self)
297297
hole_max = translate(self->u.pad.hole->u.hole.other);
298298
sort_coord(&hole_min, &hole_max);
299299

300-
box_min.x = box_min.y = box_max.x = box_max.y;
301-
maximize_box(&box_min, &box_max,
302-
pad_min.x, pad_min.y, pad_max.x, hole_min.y); /* top */
300+
box_min.x = pad_min.x; /* top */
301+
box_min.y = pad_min.y;
302+
box_max.x = pad_max.x;
303+
box_max.y = hole_min.y;
304+
303305
maximize_box(&box_min, &box_max,
304306
pad_min.x, hole_max.y, pad_max.x, pad_max.y); /* bottom */
305307
maximize_box(&box_min, &box_max,

0 commit comments

Comments
 (0)