]> 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)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 3 Jul 2010 14:50:03 +0000 (16:50 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10264 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=0cc6d620e59dc53d5162ff66c825b1655bf8cf06

cl_particles.c

index 0bc9cbc3aa5c24a61c79a61e6e3598e4081bafe0..c9cbd2bfd2990fa76b14a9382f3b8bc9a5174b69 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])
                        {