Fixed possibly placing a font glyph (at the beginning of a row) past the bottom of a font cache image.

This commit is contained in:
Zack Middleton 2012-03-29 05:15:46 +00:00
parent f15a3cca21
commit 94fb80f021

View file

@ -233,17 +233,11 @@ static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, in
// we need to make sure we fit // we need to make sure we fit
if (*xOut + scaled_width + 1 >= 255) { if (*xOut + scaled_width + 1 >= 255) {
if (*yOut + *maxHeight + 1 >= 255) {
*yOut = -1;
*xOut = -1;
ri.Free(bitmap->buffer);
ri.Free(bitmap);
return &glyph;
} else {
*xOut = 0; *xOut = 0;
*yOut += *maxHeight + 1; *yOut += *maxHeight + 1;
} }
} else if (*yOut + *maxHeight + 1 >= 255) {
if (*yOut + *maxHeight + 1 >= 255) {
*yOut = -1; *yOut = -1;
*xOut = -1; *xOut = -1;
ri.Free(bitmap->buffer); ri.Free(bitmap->buffer);