Skip to content

Commit

Permalink
[rend2] Fix out-of-bounds crash with weather
Browse files Browse the repository at this point in the history
Thanks @kuvirah for this fix
  • Loading branch information
SomaZ committed Feb 20, 2024
1 parent a35e31a commit 9952487
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/rd-rend2/tr_weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,10 @@ void RB_SurfaceWeather( srfWeather_t *surf )
{
chunkIndex = (int(centerZoneOffsetX + numMinZonesX) + x + 1) % 3;
chunkIndex += (int(centerZoneOffsetY + numMinZonesY) + y + 1) % 3 * 3;

if (chunkIndex < 0) {
chunkIndex += 9;

VectorSet2(
zoneOffsets[chunkIndex],
x,
Expand Down

0 comments on commit 9952487

Please sign in to comment.