mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Clip printext256() at xdim, don't crash OSD_Printf() with empty string.
git-svn-id: https://svn.eduke32.com/eduke32@3318 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
596b83aec1
commit
255c84c5a2
2 changed files with 10 additions and 0 deletions
|
@ -15928,6 +15928,10 @@ void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const
|
||||||
if (col)col = Batol(smallbuf);
|
if (col)col = Batol(smallbuf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stx-fontsize+charxsiz > xdim)
|
||||||
|
break;
|
||||||
|
|
||||||
letptr = &fontptr[name[i]<<3];
|
letptr = &fontptr[name[i]<<3];
|
||||||
ptr = (char *)(ylookup[ypos+7]+(stx-fontsize)+frameplace);
|
ptr = (char *)(ylookup[ypos+7]+(stx-fontsize)+frameplace);
|
||||||
for (y=7; y>=0; y--)
|
for (y=7; y>=0; y--)
|
||||||
|
|
|
@ -1525,6 +1525,12 @@ void OSD_Printf(const char *fmt, ...)
|
||||||
Bvsnprintf(tmpstr, 8192, fmt, va);
|
Bvsnprintf(tmpstr, 8192, fmt, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
|
if (tmpstr[0]==0)
|
||||||
|
{
|
||||||
|
mutex_unlock(&m_osdprintf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (tmpstr[0]=='^' && tmpstr[1]=='1' && tmpstr[2]=='0' && ++OSD_errors > MAX_ERRORS)
|
if (tmpstr[0]=='^' && tmpstr[1]=='1' && tmpstr[2]=='0' && ++OSD_errors > MAX_ERRORS)
|
||||||
{
|
{
|
||||||
if (OSD_errors == MAX_ERRORS + 1)
|
if (OSD_errors == MAX_ERRORS + 1)
|
||||||
|
|
Loading…
Reference in a new issue