diff --git a/gtk/gtkallocatedbitmask.c b/gtk/gtkallocatedbitmask.c index 6f0f1f8616..567b86cb91 100644 --- a/gtk/gtkallocatedbitmask.c +++ b/gtk/gtkallocatedbitmask.c @@ -174,11 +174,14 @@ _gtk_allocated_bitmask_intersect (GtkBitmask *mask, mask = gtk_bitmask_ensure_allocated (mask); ENSURE_ALLOCATED (other, other_allocated); - mask = gtk_allocated_bitmask_resize (mask, MIN (mask->len, other->len)); - for (i = 0; i < mask->len; i++) + for (i = 0; i < MIN (mask->len, other->len); i++) { mask->data[i] &= other->data[i]; } + for (; i < mask->len; i++) + { + mask->data[i] = 0; + } return gtk_allocated_bitmask_shrink (mask); }