Fix nullptr dereference in morpha (#870)

reported on discord, i don't have the ability to reproduce this, but it
appears to be a benign fix, as the only time that the tent2 is checked
down later is guarded by a null check.
This commit is contained in:
Jeffrey Crowell 2022-07-21 18:27:44 -04:00 committed by GitHub
parent e519caa554
commit 41d1bbe137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -929,7 +929,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
this->actor.flags &= ~ACTOR_FLAG_0;
Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f);
for (indS1 = 0; indS1 < 40; indS1++) {
if (sMorphaTent2->tentSpawnPos) {}
if (sMorphaTent2 && sMorphaTent2->tentSpawnPos) {}
indT5 = Rand_ZeroFloat(20.9f);
indS0 = sTentSpawnIndex[indT5];
spFC.x = 0;
@ -3604,4 +3604,4 @@ void BossMo_Reset(void) {
sBossGanonSeed1 = 0;
sBossGanonSeed2 = 0;
sBossGanonSeed3 = 0;
}
}