Corrected another similar bit of code causing a segfault. It is

not known, though, why the flag is set indicating valid planes
in the clientdata record when there in fact is none.  That seems
to be the underlying bug.
This commit is contained in:
Tim Edwards 2020-05-08 17:02:36 -04:00
parent 6737741902
commit 35175882bc
1 changed files with 10 additions and 5 deletions

View File

@ -1497,15 +1497,20 @@ CIFReadCellCleanup(filetype)
UndoDisable();
for (pNum = 0; pNum < MAXCIFRLAYERS; pNum++)
/* cifplanes should be valid, but don't crash magic if not */
if (cifplanes != (ClientData)CLIENTDEFAULT)
{
if (cifplanes[pNum] != NULL)
for (pNum = 0; pNum < MAXCIFRLAYERS; pNum++)
{
DBFreePaintPlane(cifplanes[pNum]);
TiFreePlane(cifplanes[pNum]);
if (cifplanes[pNum] != NULL)
{
DBFreePaintPlane(cifplanes[pNum]);
TiFreePlane(cifplanes[pNum]);
}
}
freeMagic((char *)def->cd_client);
}
freeMagic((char *)def->cd_client);
def->cd_client = (ClientData)CLIENTDEFAULT;
#if 0