Index: toolpath.c =================================================================== --- toolpath.c (revision 12014) +++ toolpath.c (revision 12015) @@ -22,6 +22,8 @@ #include "config.h" +#include + #include "toolpath.h" #include "board.h" @@ -152,7 +154,9 @@ pcb_layergrp_id_t otl; int has_otl; - result->grp = pcb_get_layergrp(pcb, layer->grp); + assert(!layer->is_bound); + + result->grp = pcb_get_layergrp(pcb, layer->meta.real.grp); has_otl = (pcb_layergrp_list(pcb, PCB_LYT_OUTLINE, &otl, 1) == 1); if (has_otl) { /* if there's an outline layer, the remove-poly shouldn't be bigger than that */