Blob Blame Raw
From b8a13c0aa01a1ee37f55a0e111d0b9681cb60deb Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat, 14 Nov 2015 09:06:45 -0600
Subject: [PATCH 1/4] Don't crash when trying to set an invalid state

https://bugzilla.gnome.org/show_bug.cgi?id=757915
---
 atspi/atspi-stateset.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/atspi/atspi-stateset.c b/atspi/atspi-stateset.c
index 1f9d993..366c48b 100644
--- a/atspi/atspi-stateset.c
+++ b/atspi/atspi-stateset.c
@@ -102,11 +102,11 @@ atspi_state_set_set_by_name (AtspiStateSet *set, const gchar *name, gboolean ena
   {
     g_warning ("AT-SPI: Attempt to set unknown state '%s'", name);
   }
-
-  if (enabled)
-    set->states |= ((gint64)1 << value->value);
   else
-    set->states &= ~((gint64)1 << value->value);
+    if (enabled)
+      set->states |= ((gint64)1 << value->value);
+    else
+      set->states &= ~((gint64)1 << value->value);
 
   g_type_class_unref (type_class);
 }
-- 
2.5.0