input: Fix possible crash in clip_pointer_motion
authorAlexander Larsson <alexl@redhat.com>
Tue, 28 May 2013 14:23:33 +0000 (16:23 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 28 May 2013 20:14:34 +0000 (16:14 -0400)
It was erronously using output->current->height in one
place where it should use output->height. This may cause
it to create an invalid clipped coordinate in case of output
scaling or transform, because the next round "prev" would
end up NULL.

src/input.c

index 129593f..89f74f4 100644 (file)
@@ -593,7 +593,7 @@ clip_pointer_motion(struct weston_seat *seat, wl_fixed_t *fx, wl_fixed_t *fy)
                                                prev->width - 1);
                if (y < prev->y)
                        *fy = wl_fixed_from_int(prev->y);
-               else if (y >= prev->y + prev->current->height)
+               else if (y >= prev->y + prev->height)
                        *fy = wl_fixed_from_int(prev->y +
                                                prev->height - 1);
        }