From 6217b3fca759b49dede767c6c99a312d3482e720 Mon Sep 17 00:00:00 2001
From: Steven Bennetts <steve@lindenlab.com>
Date: Tue, 29 Apr 2008 01:57:32 +0000
Subject: [PATCH] Fixed a bogus assert and a rare but obvious crash bug.
 Reviewed by Palmer

---
 indra/llrender/llimagegl.cpp     | 2 +-
 indra/newview/llviewerwindow.cpp | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index d5ad38dff37..a7bfe64f927 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -628,7 +628,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
 					{
 						S32 bytes = w * h * mComponents;
 						llassert(prev_mip_data);
-						llassert(prev_mip_size == bytes);
+						llassert(prev_mip_size == bytes*4);
 						U8* new_data = new U8[bytes];
 						llassert_always(new_data);
 						LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index a7530321800..2c283faf3b4 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1259,8 +1259,8 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
 	}
 
 	// restore mouse cursor
-	gViewerWindow->showCursor();
-	gViewerWindow->getWindow()->setMouseClipping(FALSE);
+	showCursor();
+	getWindow()->setMouseClipping(FALSE);
 
 	// JC - Leave keyboard focus, so if you're popping in and out editing
 	// a script, you don't have to click in the editor again and again.
@@ -1435,7 +1435,7 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window,  S32 x,  S32 y, S32 width,  S
 
 void LLViewerWindow::handleScrollWheel(LLWindow *window,  S32 clicks)
 {
-	gViewerWindow->handleScrollWheel( clicks );
+	handleScrollWheel( clicks );
 }
 
 void LLViewerWindow::handleWindowBlock(LLWindow *window)
-- 
GitLab