engine: client: cl_font: fix possible NULL dereference
This commit is contained in:
parent
ec73f23e4a
commit
f95ce7f52d
1 changed files with 5 additions and 2 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Reference in a new issue