From 41969dbaf9e9c182b215d70d963f25ac9915affe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 27 Jul 2009 16:25:43 +0000 Subject: [PATCH] Fixed off by one error that would cause the array to be not filled entirely when the gradient finished earlier than the area to be filled. This is visible when drawing only one line of the gradient when it's outside the gradient area as in ticket #3749. Though I am seriously wondering why it works when drawing more than one line. Maybe a buffer overflow in the regular case? Will investigate. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31821 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/drawing/Painter/Painter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index 0dce5b7a21..1dfd757bab 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -2905,7 +2905,7 @@ Painter::_MakeGradient(const BGradient& gradient, int32 colorCount, from = to; } // make sure we fill the entire array - if (index < arraySize - 1) { + if (index < arraySize) { int32 startIndex = max_c(index, 0); uint8* c = (uint8*)&colors[startIndex]; for (int32 i = startIndex; i < arraySize; i++) {