From 71d2b482d84246b8456ea863f94a9a766d33f197 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 19 Oct 2012 21:14:25 +0300 Subject: Add missing check in palette class. --- src/gui/palette.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/palette.h') diff --git a/src/gui/palette.h b/src/gui/palette.h index e165e8901..f18e4ed38 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -82,7 +82,7 @@ class Palette */ inline const gcn::Color &getColor(int type, int alpha = 255) { - if (type >= static_cast(mColors.size())) + if (type >= static_cast(mColors.size()) || type < 0) { logger->log("incorrect color request type: %d from %u", type, static_cast(mColors.size())); -- cgit v1.2.3-60-g2f50