diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-20 20:13:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-20 20:13:38 +0300 |
commit | ca695ea265e4922319a76e5cec28bd4eeb1b76f0 (patch) | |
tree | 1d0953ef246c347dac5317a624e4d042adfc127d /src/gui/palette.h | |
parent | f6dbee24b6a16dc4316ee5b7ebb9863723441ec4 (diff) | |
download | mv-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.tar.gz mv-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.tar.bz2 mv-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.tar.xz mv-ca695ea265e4922319a76e5cec28bd4eeb1b76f0.zip |
Add missing check in palette.h
Diffstat (limited to 'src/gui/palette.h')
-rw-r--r-- | src/gui/palette.h | 11 |
1 files changed, 6 insertions, 5 deletions
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; |