projects
/
mikachu
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36effc5
)
assert on invalid color values
author
Dana Jansens
<danakj@orodu.net>
Mon, 5 Mar 2007 05:25:16 +0000
(
05:25
+0000)
committer
Dana Jansens
<danakj@orodu.net>
Mon, 5 Mar 2007 05:25:16 +0000
(
05:25
+0000)
render/color.c
patch
|
blob
|
history
diff --git
a/render/color.c
b/render/color.c
index a9121abd2b61665a76994267c9dce70874e0098c..e4b023342c4582660e1de4cb1bf2058ed98a8b4e 100644
(file)
--- a/
render/color.c
+++ b/
render/color.c
@@
-67,6
+67,10
@@
RrColor *RrColorNew(const RrInstance *inst, gint r, gint g, gint b)
XColor xcol;
gint key;
+ g_assert(r >= 0 && r < 256);
+ g_assert(g >= 0 && g < 256);
+ g_assert(b >= 0 && b < 256);
+
key = (r << 24) + (g << 16) + (b << 8);
#ifndef NO_COLOR_CACHE
if ((out = g_hash_table_lookup(RrColorHash(inst), &key))) {