Corrected a failure to check for an invalid layer in the routine

that queries a default layer width.  Otherwise this can cause a
segfault, especially when a technology file has not been specified
and the minimum tech is in effect.
This commit is contained in:
Tim Edwards 2022-08-26 20:59:50 -04:00
parent eed9882bf2
commit 2d4fb51ae6
1 changed files with 6 additions and 0 deletions

View File

@ -4153,6 +4153,12 @@ DRCGetDefaultLayerWidth(ttype)
DRCCookie *cptr;
TileTypeBitMask *set;
if (ttype < 0)
{
TxError("Error: Attempt to get default width of invalid layer!\n");
return 0;
}
for (cptr = DRCCurStyle->DRCRulesTbl[TT_SPACE][ttype]; cptr != (DRCCookie *) NULL;
cptr = cptr->drcc_next)
{