assert on invalid color values
This commit is contained in:
parent
36effc5ab7
commit
d209d828a7
1 changed files with 4 additions and 0 deletions
|
@ -67,6 +67,10 @@ RrColor *RrColorNew(const RrInstance *inst, gint r, gint g, gint b)
|
||||||
XColor xcol;
|
XColor xcol;
|
||||||
gint key;
|
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);
|
key = (r << 24) + (g << 16) + (b << 8);
|
||||||
#ifndef NO_COLOR_CACHE
|
#ifndef NO_COLOR_CACHE
|
||||||
if ((out = g_hash_table_lookup(RrColorHash(inst), &key))) {
|
if ((out = g_hash_table_lookup(RrColorHash(inst), &key))) {
|
||||||
|
|
Loading…
Reference in a new issue