[quake3-commits] r2228 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Mar 29 01:28:09 EDT 2012


Author: ztm
Date: 2012-03-29 01:28:09 -0400 (Thu, 29 Mar 2012)
New Revision: 2228

Modified:
   trunk/code/renderer/tr_font.c
Log:
Make sure font glyph shader names are null-terminated.

Modified: trunk/code/renderer/tr_font.c
===================================================================
--- trunk/code/renderer/tr_font.c	2012-03-29 05:15:46 UTC (rev 2227)
+++ trunk/code/renderer/tr_font.c	2012-03-29 05:28:09 UTC (rev 2228)
@@ -397,8 +397,8 @@
 			font->glyphs[i].s2			= readFloat();
 			font->glyphs[i].t2			= readFloat();
 			font->glyphs[i].glyph		= readInt();
-			Com_Memcpy(font->glyphs[i].shaderName, &fdFile[fdOffset], 32);
-			fdOffset += 32;
+			Q_strncpyz(font->glyphs[i].shaderName, (const char *)&fdFile[fdOffset], sizeof(font->glyphs[i].shaderName));
+			fdOffset += sizeof(font->glyphs[i].shaderName);
 		}
 		font->glyphScale = readFloat();
 		Com_Memcpy(font->name, &fdFile[fdOffset], MAX_QPATH);



More information about the quake3-commits mailing list