Skip to content

Commit 258adee

Browse files
fix(w3ddevice): Add null check for tree tile RGB data in W3DTreeBuffer::drawTrees
1 parent 123d592 commit 258adee

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ int W3DTreeBuffer::W3DTreeTextureClass::update(W3DTreeBuffer* buffer)
169169
}
170170
Int i, j;
171171
for (j = 0; j < tilePixelExtent; j++) {
172-
UnsignedByte* pBGR = pTile->getRGBDataForWidth(tilePixelExtent);
172+
UnsignedByte* pTileRGB = pTile->getRGBDataForWidth(tilePixelExtent);
173+
if (!pTileRGB) continue;
174+
UnsignedByte* pBGR = pTileRGB;
173175
pBGR += (tilePixelExtent - (1 + j)) * TILE_BYTES_PER_PIXEL * tilePixelExtent; // invert to match.
174176
Int row = position.y + j;
175177
UnsignedByte* pBGRA = ((UnsignedByte*)locked_rect.pBits) +
@@ -1989,4 +1991,8 @@ void W3DTreeBuffer::loadPostProcess()
19891991

19901992

19911993

1994+
1995+
1996+
1997+
19921998

0 commit comments

Comments
 (0)