diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2013-01-13 01:44:43 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:48:38 +0300 |
commit | d3d1741fecbd41afd7c44b237c564ce6356f2bbe (patch) | |
tree | 2250dceb9e19b60938ea14d6ccfdf7e51bc3d256 /graphics/text_element.cpp | |
parent | 618355876ac9190cf113c4c07d999de72d5eb183 (diff) |
fixed crash with long strings packing.
Diffstat (limited to 'graphics/text_element.cpp')
-rw-r--r-- | graphics/text_element.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/graphics/text_element.cpp b/graphics/text_element.cpp index 924b7516a1..b2bea7aaff 100644 --- a/graphics/text_element.cpp +++ b/graphics/text_element.cpp @@ -119,10 +119,14 @@ namespace graphics resInfos[i] = &glyphInfos[i]; } - if (firstVis != lastVis) - screen->mapInfo(&resInfos[firstVis], - &glyphIDs[firstVis], - lastVis - firstVis); + if ((firstVis != lastVis) + && !screen->mapInfo(&resInfos[firstVis], + &glyphIDs[firstVis], + lastVis - firstVis)) + { + LOG(LINFO, ("cannot render string", lastVis - firstVis, "characters long")); + return; + } for (unsigned i = firstVis; i < lastVis; ++i) { |