Skip to content

Commit

Permalink
wintab: fix skipping of odd-numbered devices
Browse files Browse the repository at this point in the history
Fix a regression introduced in 4ce6d10
which causes devices with an odd-numbered zero-based index in the list
to be passed over incorrectly. This might present as yet another "device
does not send pressure" bug for ~50% of devices out there.

This commit also closes off another potential segfault for wintab_devices
lists which have an odd length.

https://bugzilla.gnome.org/show_bug.cgi?id=774699
  • Loading branch information
achadwick authored and nacho committed Nov 21, 2016
1 parent 7ae8371 commit 6e197af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gdk/win32/gdkdevicemanager-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,9 @@ gdk_device_manager_find_wintab_device (GdkDeviceManagerWin32 *device_manager,
GdkDeviceWintab *device;
GList *tmp_list;

for (tmp_list = device_manager->wintab_devices; tmp_list; tmp_list = tmp_list->next)
for (tmp_list = device_manager->wintab_devices; tmp_list != NULL; tmp_list = tmp_list->next)
{
device = tmp_list->data;
tmp_list = tmp_list->next;

if (device->hctx == hctx &&
device->cursor == cursor)
Expand Down

0 comments on commit 6e197af

Please sign in to comment.