From a2c9faed29c422654d7640be34e69d4574f3d9f5 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Tue, 17 Feb 2009 20:50:30 +0000 Subject: Fixed bug #2609755 (GUI memory corruption). svn-id: r38447 --- graphics/VectorRendererSpec.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'graphics') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 667e668d8f..d358bde1aa 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -1096,6 +1096,10 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto PixelType *ptr_right = 0, *ptr_left = 0; + if (x1 + size > Base::_activeSurface->w || x1 < 0 || + y1 + size > Base::_activeSurface->h || y1 < 0) + return; + if (inverted) { ptr_left = (PixelType *)_activeSurface->getBasePtr(x1, y1); ptr_right = (PixelType *)_activeSurface->getBasePtr(x1 + size, y1); -- cgit v1.2.3