Index: obj_line_drcenf.c =================================================================== --- obj_line_drcenf.c (revision 7780) +++ obj_line_drcenf.c (revision 7781) @@ -286,7 +286,7 @@ length = coord_abs(dy); } group = pcb_layer_get_group(PCB, INDEXOFCURRENT); - comp = pcb_max_group + 10; /* this out-of-range group might save a call */ + comp = PCB->LayerGroups.len + 10; /* this out-of-range group might save a call */ if (pcb_layergrp_flags(PCB, group) & PCB_LYT_BOTTOM) info.solder = pcb_true; else { @@ -441,7 +441,7 @@ /* prepare for the intersection search */ group = pcb_layer_get_group(PCB, INDEXOFCURRENT); - comp = pcb_max_group + 10; /* this out-of-range group might save a call */ + comp = PCB->LayerGroups.len + 10; /* this out-of-range group might save a call */ if (pcb_layergrp_flags(PCB, group) & PCB_LYT_BOTTOM) info.solder = pcb_true; else {