]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
TE_EXPLOSION2: don't crash on colorLength == 0.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Mar 2015 13:59:44 +0000 (13:59 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 Mar 2015 13:59:44 +0000 (13:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12205 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c

index 26a0ed1120a4891854fdf6a8fcb68a80bd32adef..923e48e734ad8471ead538b2f1f6783e19fc8f30 100644 (file)
@@ -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);