commit ba69156c910fc68418e2b27b6ad6ef24ad584f67 Author: Stephen Lyons Date: Thu Jun 19 04:13:17 2014 +0100 BugFix: Prevent SegFault crash on right click in time-stamp line in console. Duplicates in right mouse click code the minimum value limiting snippet used in left mouse click that prevent negative X mouse character coordinates being used to index into console buffer data. Absence of this piece of code fatally crashes Mudlet without warning if a right click (context menu) is made in the area of the console screen where time-stamps are shown. This is a High priority fix needed for current release code. http://bugs.launchpad.net/mudlet/+bug/1329948 directly relates to this. Signed-off-by: Stephen Lyons diff --git a/src/TTextEdit.cpp b/src/TTextEdit.cpp index 180d976..ed2c66a 100755 --- a/src/TTextEdit.cpp +++ b/src/TTextEdit.cpp @@ -1337,6 +1337,8 @@ void TTextEdit::mousePressEvent( QMouseEvent * event ) x -= 13; } int y = ( event->y() / mFontHeight ) + imageTopLine(); + if( x < 0 ) x = 0; + if( y < 0 ) y = 0; if( y < static_cast(mpBuffer->buffer.size()) ) { if( x < static_cast(mpBuffer->buffer[y].size()) )