Index: toolpath.c =================================================================== --- toolpath.c (revision 19374) +++ toolpath.c (revision 19375) @@ -162,7 +162,7 @@ otlbb.X1 = otlbb.Y1 = PCB_MAX_COORD; otlbb.X2 = otlbb.Y2 = -PCB_MAX_COORD; - for(lid = 0; lid < pcb->Data->Layer; lid++) { + for(lid = 0; lid < pcb->Data->LayerN; lid++) { pcb_layer_t *l; if (!PCB_LAYER_IS_OUTLINE(pcb_layer_flags(PCB, lid), pcb_layer_purpose(PCB, lid, NULL))) continue;