From 42b50051acdf8227c23f6628aa7b8f953fe8ff70 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 6 Feb 2020 10:52:24 +0100 Subject: [PATCH] magnifier: Sanity check coordinates in scrollContentsTo We may receive a11y events with bogus coordinates (eg. x/y = minint), so ensure the coordinates are sane before scrolling there. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/984 --- js/ui/magnifier.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 7250ce530..497819640 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -1168,6 +1168,10 @@ var ZoomRegion = class ZoomRegion { * @param {number} y: The y-coord of the point to center on. */ scrollContentsTo(x, y) { + if (x < 0 || x > global.screen_width || + y < 0 || y > global.screen_height) + return; + this._clearScrollContentsTimer(); this._followingCursor = false;