From cabc69deb2771c1e88fc1f540eb10e89ada8897c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 25 Dec 2010 23:24:27 +0200 Subject: Fix crash with corrupted links in chat. Reviewed-by: Kage --- src/gui/widgets/browserbox.cpp | 4 ++-- 1 file 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; -- cgit v1.2.3-70-g09d2