diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-03-05 05:25:16 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-03-05 05:25:16 +0000 |
| commit | d209d828a7aceea9da59da980cd57f50757f3a29 (patch) | |
| tree | e176c36ec2db2600d8c95f52932ff88cbc646553 | |
| parent | 36effc5ab7cc1fb656d2547a291ffe57e4cef44c (diff) | |
assert on invalid color values
| -rw-r--r-- | render/color.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/render/color.c b/render/color.c index a9121abd..e4b02334 100644 --- 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))) { |
