From f48d98c132a9b3ddc852db6b497e943caa688a76 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:30:19 -0500 Subject: [PATCH 1/2] multistruct: Improve sanity checks --- src/multistruct.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multistruct.cpp b/src/multistruct.cpp index 8234dc8f1f4..80781283e15 100644 --- a/src/multistruct.cpp +++ b/src/multistruct.cpp @@ -225,7 +225,7 @@ bool recvLasSat(NETQUEUE queue) return false; } - if (psStruct && psObj && psStruct->pStructureType->psWeapStat[0]->weaponSubClass == WSC_LAS_SAT) + if (psStruct && psObj && isLasSat(psStruct->pStructureType)) { // Lassats have just one weapon unsigned firePause = weaponFirePause(*psStruct->getWeaponStats(0), player); From 3d653b23fba569629075e6cbbb7c0a0a12dab569 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:36:13 -0500 Subject: [PATCH 2/2] displayProximityMsgs: Additional sanity checks --- src/display3d.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/display3d.cpp b/src/display3d.cpp index 6ece53e1847..5588583487d 100644 --- a/src/display3d.cpp +++ b/src/display3d.cpp @@ -2320,7 +2320,15 @@ static void displayProximityMsgs(const glm::mat4& viewMatrix, const glm::mat4 &p unsigned x, y; if (psProxDisp->type == POS_PROXDATA) { + if (!psProxDisp->psMessage->pViewData) + { + continue; + } VIEW_PROXIMITY *pViewProximity = (VIEW_PROXIMITY *)psProxDisp->psMessage->pViewData->pData; + if (!pViewProximity) + { + continue; + } x = pViewProximity->x; y = pViewProximity->y; }