Skip to content

Commit

Permalink
Fixed|Map Importer: Potential crash
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 13, 2019
1 parent 4225810 commit 275f69f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doomsday/apps/plugins/importidtech1/src/mapimporter.cpp
Expand Up @@ -953,10 +953,13 @@ DENG2_PIMPL(MapImporter)

if (hit.valid && hit.t > 0.0 && hit.t < nearestContainer.first)
{
const int sector = sides[line.sideIndex(hit.side)].sector;
if (sector >= 0 && !sectors[sector].hackFlags)
if (line.hasSide(hit.side))
{
nearestContainer = {hit.t, sector};
const int sector = sides[line.sideIndex(hit.side)].sector;
if (sector >= 0 && !sectors[sector].hackFlags)
{
nearestContainer = {hit.t, sector};
}
}
}
}
Expand Down Expand Up @@ -1302,6 +1305,9 @@ DENG2_PIMPL(MapImporter)

DENG2_FOR_EACH(Sectors, i, sectors)
{
// Never should have linked to a hacked sector.
DENG2_ASSERT(i->visPlaneLinkSector < 0 || !sectors[i->visPlaneLinkSector].hackFlags);

dint idx = MPE_SectorCreate(
dfloat(i->lightLevel) / 255.0f, 1, 1, 1, i->index, i->visPlaneLinkSector);

Expand Down

0 comments on commit 275f69f

Please sign in to comment.