summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-12-25 23:24:27 +0200
committerAndrei Karas <akaras@inbox.ru>2010-12-26 21:20:40 +0200
commitcabc69deb2771c1e88fc1f540eb10e89ada8897c (patch)
treef3c3bb5c12a151c57594362e3999a3175173fd5a
parent4bb2616ed97dc6e12a0efb26ca233c5a3eac1807 (diff)
downloadmana-cabc69deb2771c1e88fc1f540eb10e89ada8897c.tar.gz
mana-cabc69deb2771c1e88fc1f540eb10e89ada8897c.tar.bz2
mana-cabc69deb2771c1e88fc1f540eb10e89ada8897c.tar.xz
mana-cabc69deb2771c1e88fc1f540eb10e89ada8897c.zip
Fix crash with corrupted links in chat.
Reviewed-by: Kage
-rw-r--r--src/gui/widgets/browserbox.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 81f54212..735c1833 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -280,7 +280,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
- if (mSelectedLink >= 0)
+ if (mSelectedLink >= 0 && mSelectedLink < mLinks.size())
{
if ((mHighMode & BACKGROUND))
{
@@ -423,7 +423,7 @@ int BrowserBox::calcHeight()
}
}
- if (c == '<')
+ if (c == '<' && link < mLinks.size())
{
const int size =
font->getWidth(mLinks[link].caption) + 1;