From 9ae2f3cd4d3019ed440b8c6e604163742679d20c Mon Sep 17 00:00:00 2001
From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Fri, 2 Jul 2010 02:44:03 +0000
Subject: [PATCH] fix a crash in particlefont.txt parser when given no
 texcoords

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10264 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=0cc6d620e59dc53d5162ff66c825b1655bf8cf06
---
 cl_particles.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cl_particles.c b/cl_particles.c
index 0bc9cbc3..c9cbd2bf 100644
--- a/cl_particles.c
+++ b/cl_particles.c
@@ -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])
 			{
-- 
2.39.5