mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-28 23:00:27 +01:00
Added a check to avoid packed from being out of bounds in MSG_PackCoord()
This commit is contained in:
1 file changed
+5
-1
@@ -2157,7 +2157,11 @@ int MSG_PackAlpha(float alpha, int bits)
|
||||
int MSG_PackCoord(float coord)
|
||||
{
|
||||
unsigned int packed = (unsigned int)round(coord * 4.0 + MAX_PACKED_COORD_HALF);
|
||||
coordstats[packed]++;
|
||||
if (packed >= MAX_PACKED_COORD) {
|
||||
Com_DPrintf("Illegal XYZ coordinates for an entity, small information lost in transmission\n");
|
||||
} else {
|
||||
coordstats[packed]++;
|
||||
}
|
||||
|
||||
return packed;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user