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 08652af..2cc4e65 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])
                        {