From ca695ea265e4922319a76e5cec28bd4eeb1b76f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 20 Sep 2012 20:13:38 +0300 Subject: Add missing check in palette.h --- src/gui/palette.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/palette.h b/src/gui/palette.h index b1111c56b..0c3c2dc87 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -78,11 +78,12 @@ class Palette */ inline const gcn::Color &getColor(int type, int alpha = 255) { -// if (type >= (signed)mColors.size()) -// { -// logger->log("request type: %d", type); -// logger->log("size: %ld", mColors.size()); -// } + if (type >= (signed)mColors.size()) + { + logger->log("incorrect color request type: %d from %ld", + type, mColors.size()); + type = 0; + } gcn::Color* col = &mColors[type].color; col->a = alpha; return *col; -- cgit v1.2.3-70-g09d2