summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2012-03-29 05:15:46 +0000
committerTim Angus <tim@ngus.net>2013-01-12 20:19:20 +0000
commit4d0ed9ce8bde63a40c98b495f66f6c0411e84b23 (patch)
tree161f6b6cc2f4ac085fb92f2ef12cbee2cf974113
parent0c3ffd26f260732cbacfb67bab34f915f27afe2c (diff)
Fixed possibly placing a font glyph (at the beginning of a row) past the bottom of a font cache image.
-rw-r--r--src/renderer/tr_font.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/renderer/tr_font.c b/src/renderer/tr_font.c
index 14349934..25954b66 100644
--- a/src/renderer/tr_font.c
+++ b/src/renderer/tr_font.c
@@ -234,17 +234,11 @@ static glyphInfo_t *RE_ConstructGlyphInfo(unsigned char *imageOut, int *xOut, in
// we need to make sure we fit
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;
- *yOut += *maxHeight + 1;
- }
- } else if (*yOut + *maxHeight + 1 >= 255) {
+ *xOut = 0;
+ *yOut += *maxHeight + 1;
+ }
+
+ if (*yOut + *maxHeight + 1 >= 255) {
*yOut = -1;
*xOut = -1;
ri.Free(bitmap->buffer);