From 9c29488044140007d68275cfe5f59d242dce4272 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Wed, 20 Nov 2013 10:33:15 +0100 Subject: [PATCH] If the text is too skinny to render, don't crash --- indra/llrender/llfontgl.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 6a353d06c..3626c88ea 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -150,7 +150,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons return wstr.length() ; } - if (wstr.empty()) + if (wstr.empty() || !max_pixels) { return 0; } @@ -440,11 +440,14 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } } - gGL.begin(LLRender::QUADS); + if(glyph_count) { - gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + gGL.begin(LLRender::QUADS); + { + gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + } + gGL.end(); } - gGL.end(); if (right_x)