All pastes #1847075 Raw Edit

Mine

public diff v1 · immutable
#1847075 ·published 2010-03-20 21:29 UTC
rendered paste body
From a35e279b8a7cd5cac4ffa2d77b090da28bd3f4c7 Mon Sep 17 00:00:00 2001From: Andrei Karas <akaras@inbox.ru>Date: Sat, 20 Mar 2010 23:06:52 +0200Subject: [PATCH] Fix memory corruption in rainbow colors--- src/resources/dye.cpp |    3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)diff --git a/src/resources/dye.cpp b/src/resources/dye.cppindex 85a87aa..1cf1742 100644--- a/src/resources/dye.cpp+++ b/src/resources/dye.cpp@@ -107,6 +107,9 @@ void DyePalette::getColor(int intensity, int color[3]) const     int i = intensity * last / 255;     int t = intensity * last % 255; +    if (j >= last)+        j = -1;+     int j = t != 0 ? i : i - 1;     // Get the exact color if any, the next color otherwise.     int r2 = mColors[j + 1].value[0],-- 1.7.0.2