Avoid infinite loop if a mask is zero. (#309222, David Saxton)

2005-06-30  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkvisual-x11.c (gdk_visual_decompose_mask): Avoid
	infinite loop if a mask is zero.  (#309222, David Saxton)
This commit is contained in:
Matthias Clasen
2005-06-30 19:11:58 +00:00
committed by Matthias Clasen
parent 58824aa9bb
commit 8833e0d3c3
4 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2005-06-30 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkvisual-x11.c (gdk_visual_decompose_mask): Avoid
infinite loop if a mask is zero. (#309222, David Saxton)
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_fetch_child):
Clarify the code, gcc 4 complains about predecrement in MAX().

View File

@ -1,5 +1,8 @@
2005-06-30 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkvisual-x11.c (gdk_visual_decompose_mask): Avoid
infinite loop if a mask is zero. (#309222, David Saxton)
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_fetch_child):
Clarify the code, gcc 4 complains about predecrement in MAX().

View File

@ -1,5 +1,8 @@
2005-06-30 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkvisual-x11.c (gdk_visual_decompose_mask): Avoid
infinite loop if a mask is zero. (#309222, David Saxton)
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_fetch_child):
Clarify the code, gcc 4 complains about predecrement in MAX().

View File

@ -618,6 +618,12 @@ gdk_visual_decompose_mask (gulong mask,
*shift = 0;
*prec = 0;
if (mask == 0)
{
g_warning ("Mask is 0 in visual. Server bug ?");
return;
}
while (!(mask & 0x1))
{
(*shift)++;