Index: vtkInteractorStyleRubberBandZoom.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Rendering/vtkInteractorStyleRubberBandZoom.cxx,v
retrieving revision 1.7
diff -u -8 -p -r1.7 vtkInteractorStyleRubberBandZoom.cxx
--- vtkInteractorStyleRubberBandZoom.cxx	23 Feb 2008 17:18:46 -0000	1.7
+++ vtkInteractorStyleRubberBandZoom.cxx	23 Jun 2008 13:09:04 -0000
@@ -42,32 +42,41 @@ void vtkInteractorStyleRubberBandZoom::O
   if (!this->Interactor || !this->Moving)
     {
     return;
     }
   
   this->EndPosition[0] = this->Interactor->GetEventPosition()[0];
   this->EndPosition[1] = this->Interactor->GetEventPosition()[1];  
   
+  int *size = this->Interactor->GetRenderWindow()->GetSize();
+  if( this->EndPosition[0] > size[0] ||
+      this->EndPosition[0] < 0 ||
+      this->EndPosition[1] > size[1] ||
+      this->EndPosition[1] < 0 ) 
+  {
+  return;
+  }
+
+	   
   vtkUnsignedCharArray *tmpPixelArray = vtkUnsignedCharArray::New();
   tmpPixelArray->DeepCopy(this->PixelArray);
   
   unsigned char *pixels = tmpPixelArray->GetPointer(0);
   
   int min[2], max[2];
   min[0] = this->StartPosition[0] <= this->EndPosition[0] ?
     this->StartPosition[0] : this->EndPosition[0];
   min[1] = this->StartPosition[1] <= this->EndPosition[1] ?
     this->StartPosition[1] : this->EndPosition[1];
   max[0] = this->EndPosition[0] > this->StartPosition[0] ?
     this->EndPosition[0] : this->StartPosition[0];
   max[1] = this->EndPosition[1] > this->StartPosition[1] ?
     this->EndPosition[1] : this->StartPosition[1];
 
-  int *size = this->Interactor->GetRenderWindow()->GetSize();
   
   int i;
   for (i = min[0]; i <= max[0]; i++)
     {
     pixels[3*(min[1]*size[0]+i)] = 255 ^ pixels[3*(min[1]*size[0]+i)];
     pixels[3*(min[1]*size[0]+i)+1] = 255 ^ pixels[3*(min[1]*size[0]+i)+1];
     pixels[3*(min[1]*size[0]+i)+2] = 255 ^ pixels[3*(min[1]*size[0]+i)+2];
     pixels[3*(max[1]*size[0]+i)] = 255 ^ pixels[3*(max[1]*size[0]+i)];
