]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a crash in particlefont.txt parser when given no texcoords
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Jul 2010 02:44:03 +0000 (02:44 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Jul 2010 02:44:03 +0000 (02:44 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10264 d7cf8633-e32d-0410-b094-e92efae38249

cl_particles.c

index 08652af41bcc11091976fc477a264ec4aa745c9e..2cc4e658b8253be2a070af995cac5b1f65ee2d01 100644 (file)
@@ -2209,9 +2209,11 @@ static void R_InitParticleTexture (void)
 
                        if (COM_ParseToken_Simple(&bufptr, true, false) && strcmp(com_token, "\n"))
                        {
+                               strlcpy(texturename, com_token, sizeof(texturename));
                                s1 = atof(com_token);
                                if (COM_ParseToken_Simple(&bufptr, true, false) && strcmp(com_token, "\n"))
                                {
+                                       texturename[0] = 0;
                                        t1 = atof(com_token);
                                        if (COM_ParseToken_Simple(&bufptr, true, false) && strcmp(com_token, "\n"))
                                        {
@@ -2226,10 +2228,7 @@ static void R_InitParticleTexture (void)
                                        }
                                }
                                else
-                               {
                                        s1 = 0;
-                                       strlcpy(texturename, com_token, sizeof(texturename));
-                               }
                        }
                        if (!texturename[0])
                        {