Fixed crash by VB/IB overflow in text rendering

This commit is contained in:
r.kuznetsov 2017-08-15 12:47:54 +03:00 committed by Vladimir Byko-Ianko
parent ceace2c4ac
commit 74ed493441

View file

@ -227,6 +227,11 @@ void CaptionDescription::Init(FeatureType const & f,
else
f.GetReadableName(true /* allowTranslit */, deviceLang, m_mainText);
// Set max text size to avoid VB/IB overflow in rendering.
size_t constexpr kMaxTextSize = 200;
if (m_mainText.size() > kMaxTextSize)
m_mainText = m_mainText.substr(0, kMaxTextSize) + "...";
m_roadNumber = f.GetRoadNumber();
m_houseNumber = f.GetHouseNumber();