neutrino: avoid crash in channellist with extreme font sizes

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@235 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2010-01-31 15:29:12 +00:00
parent f68f9fed95
commit 29d88227b9

View File

@@ -1324,9 +1324,11 @@ void CChannelList::paintDetails(int index)
text1 = text1.substr( 0, pos );
} while ( ( pos != -1 ) && (g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text1, true) > (width - 30 - seit_len) ) );
std::string text3 = p_event->description.substr(text1.length()+ 1);
std::string text3 = ""; /* not perfect, but better than crashing... */
if (p_event->description.length() > text1.length())
text3 = p_event->description.substr(text1.length()+ 1);
if (!(text2.empty()))
if (!text2.empty() && !text3.empty())
text3= text3+ " - ";
xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true);