mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-07 12:50:38 +08:00
engine: client: cl_font: fix possible NULL dereference
This commit is contained in:
@@ -368,8 +368,11 @@ void CL_DrawStringLen( cl_font_t *font, const char *s, int *width, int *height,
|
||||
{
|
||||
draw_len += font->charWidths[number];
|
||||
|
||||
if( draw_len > *width )
|
||||
*width = draw_len;
|
||||
if( width )
|
||||
{
|
||||
if( draw_len > *width )
|
||||
*width = draw_len;
|
||||
}
|
||||
}
|
||||
|
||||
s++;
|
||||
|
||||
Reference in New Issue
Block a user