From 74b3ac244d275048cd0d070ceb7c67ca55f50aba Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 31 Jan 2010 15:29:12 +0000 Subject: [PATCH] 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 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/29d88227b977241bb21ab991c247045d200c5bb8 Author: Stefan Seyfried Date: 2010-01-31 (Sun, 31 Jan 2010) --- src/gui/channellist.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index eea4e5050..5a6da96d5 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -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);