]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
CL_Effect (called by svc_effect parsing) now sanity checks framerate and framecount
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 22 Jan 2007 10:38:06 +0000 (10:38 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 22 Jan 2007 10:38:06 +0000 (10:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6717 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 95301a9784803ec02758f291edd074668e65315c..e41c9254ad5dffe1bde99c883ff21adf93367b24 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -574,6 +574,16 @@ void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float
        cl_effect_t *e;
        if (!modelindex) // sanity check
                return;
+       if (framerate < 1)
+       {
+               Con_Printf("CL_Effect: framerate %f is < 1\n", framerate);
+               return;
+       }
+       if (framecount < 1)
+       {
+               Con_Printf("CL_Effect: framecount %i is < 1\n", framecount);
+               return;
+       }
        for (i = 0, e = cl.effects;i < cl.max_effects;i++, e++)
        {
                if (e->active)