X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=render%2Fcolor.c;h=e4b023342c4582660e1de4cb1bf2058ed98a8b4e;hb=88204502a800f57b582e829d25cfeb899d444802;hp=a9121abd2b61665a76994267c9dce70874e0098c;hpb=d9f14c1d010860e658f4a9adc6682e0264b410aa;p=chaz%2Fopenbox 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))) {