tuxtxt.cpp: fixheap buffer overflow

This commit is contained in:
Jacek Jendrzej
2015-06-22 19:24:53 +02:00
parent 60c45ec06c
commit 160dda776c

View File

@@ -4765,7 +4765,8 @@ void RenderChar(int Char, tstPageAttr *Attribute, int zoom, int yoffset)
for (Pitch = 0; Pitch < sbit->pitch; Pitch++) for (Pitch = 0; Pitch < sbit->pitch; Pitch++)
{ {
if (sbit_diacrit->pitch > Pitch && sbit_diacrit->height > Row) if (sbit_diacrit->pitch > Pitch && sbit_diacrit->height > Row)
sbitbuffer[Row*sbit->pitch+Pitch] |= sbit_diacrit->buffer[Row*sbit->pitch+Pitch]; if((sbit_diacrit->pitch*sbit_diacrit->height) > (Row*sbit->pitch+Pitch))
sbitbuffer[Row*sbit->pitch+Pitch] |= sbit_diacrit->buffer[Row*sbit->pitch+Pitch];
} }
} }
} }