GdkRgb documentation/code mismatch [crash]



Hello.

While debugging mozilla I found a debugging/code mismatch...

The docs says that if you do gdk_rgb_set_min_colors(256) you should
always get a private colormap (on 8bpp visuals).

Setting it to 256 and running testrgb for instance will make gdkrgb
coredump since it is first unable to find a color cube which uses more
than the 256 col limit, generates a private colormap and tries again..
Failing this time as well and leaving gdk in an undefined state ->
crash.

So, from what I think I've found out, if you fail to allocate a cube the
first round, set the gdk_rgb_min_colors = 0 (around gdkrgb.c:620 or so)
to make sure you can get one in the private map.

Setting gdk_rgb_set_min_colors() to anything more than the largest cube
(6x6x6 -> 216) will crash gdk...

PS. I'm not 100% sure about exactly how it decides stuff, but setting
min_colors to the value "recommended" by the docs makes it segfault.

/Tomas
-- 
Tomas Ögren, stric@ing.umu.se, http://www.ing.umu.se/~stric/
|- Student at Computing Science, University of Umeå
`- Sysadmin at {cs,ing,acc}.umu.se



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]