Skip to content

Commit 4d17055

Browse files
authored
Merge pull request #491 from GeneralsOnlineDevelopmentTeam/seer/fix/w3d-treebuffer-null-mesh
bugfix(w3ddevice): Prevent null pointer dereference in W3DTreeBuffer for invalid tree meshes
2 parents 8b4870c + 3b76141 commit 4d17055

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ void W3DTreeBuffer::updateVertexBuffer()
10141014
Real theSin = m_trees[curTree].sin;
10151015
Real theCos = m_trees[curTree].cos;
10161016
if (type<0 || m_treeTypes[type].m_mesh == nullptr) {
1017-
type = 0;
1017+
continue; // No valid mesh for this tree type, skip to avoid null pointer dereference.
10181018
}
10191019

10201020
Int startVertex = m_trees[curTree].firstIndex;
@@ -2038,3 +2038,7 @@ void W3DTreeBuffer::loadPostProcess()
20382038

20392039

20402040

2041+
2042+
2043+
2044+

0 commit comments

Comments
 (0)