[gtk+/gtk-3-22] wintab tilt: Check return location for validity



commit dd6a00bb31051c5ee86f7e4a1d62f878a1cd99f7
Author: Andrew Chadwick <a t chadwick gmail com>
Date:   Tue Nov 22 10:28:40 2016 +0000

    wintab tilt: Check return location for validity
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774265

 gdk/win32/gdkdevicemanager-win32.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c
index 4699ab6..86d23ca 100644
--- a/gdk/win32/gdkdevicemanager-win32.c
+++ b/gdk/win32/gdkdevicemanager-win32.c
@@ -812,6 +812,8 @@ decode_tilt (gint   *axis_data,
 {
   double az, el;
 
+  g_return_if_fail (axis_data != NULL);
+
   /* The wintab driver for the Wacom ArtPad II reports
    * PK_ORIENTATION in CSR_PKTDATA, but the tablet doesn't
    * actually sense tilt. Catch this by noticing that the
@@ -822,7 +824,7 @@ decode_tilt (gint   *axis_data,
    * sensible tilts will need both, so only add the GDK tilt axes
    * if both wintab axes are going to be well-behaved in use.
    */
-  if ((axes == NULL) || (axis_data == NULL) ||
+  if ((axes == NULL) ||
       (axes[0].axResolution == 0) ||
       (axes[1].axResolution == 0))
     {


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