From: divverent Date: Mon, 9 Mar 2015 13:59:44 +0000 (+0000) Subject: TE_EXPLOSION2: don't crash on colorLength == 0. X-Git-Tag: xonotic-v0.8.5~88^2~116 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8638acde4621e890915bf5d13bff92b99d6a218;p=xonotic%2Fdarkplaces.git TE_EXPLOSION2: don't crash on colorLength == 0. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12205 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 26a0ed11..923e48e7 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -2893,6 +2893,8 @@ static void CL_ParseTempEntity(void) CL_FindNonSolidLocation(pos, pos, 10); colorStart = MSG_ReadByte(&cl_message); colorLength = MSG_ReadByte(&cl_message); + if (colorLength == 0) + colorLength = 1; CL_ParticleExplosion2(pos, colorStart, colorLength); tempcolor = palette_rgb[(rand()%colorLength) + colorStart]; color[0] = tempcolor[0] * (2.0f / 255.0f);