Commit 8833e0d3 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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)
parent 58824aa9
2005-06-30 Matthias Clasen <mclasen@redhat.com> 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): * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_fetch_child):
Clarify the code, gcc 4 complains about predecrement in MAX(). Clarify the code, gcc 4 complains about predecrement in MAX().
......
2005-06-30 Matthias Clasen <mclasen@redhat.com> 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): * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_fetch_child):
Clarify the code, gcc 4 complains about predecrement in MAX(). Clarify the code, gcc 4 complains about predecrement in MAX().
......
2005-06-30 Matthias Clasen <mclasen@redhat.com> 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): * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_fetch_child):
Clarify the code, gcc 4 complains about predecrement in MAX(). Clarify the code, gcc 4 complains about predecrement in MAX().
......
...@@ -618,6 +618,12 @@ gdk_visual_decompose_mask (gulong mask, ...@@ -618,6 +618,12 @@ gdk_visual_decompose_mask (gulong mask,
*shift = 0; *shift = 0;
*prec = 0; *prec = 0;
if (mask == 0)
{
g_warning ("Mask is 0 in visual. Server bug ?");
return;
}
while (!(mask & 0x1)) while (!(mask & 0x1))
{ {
(*shift)++; (*shift)++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment