wayland/keyboard: Avoid a division by zero
We don't further sanitize the values since the protocol allows for everything as long as it's non-negative. https://bugzilla.gnome.org/show_bug.cgi?id=776919
This commit is contained in:
parent
b465546a52
commit
4d300db0e2
@ -514,7 +514,11 @@ notify_key_repeat_for_resource (MetaWaylandKeyboard *keyboard,
|
|||||||
interval = g_settings_get_uint (keyboard->settings, "repeat-interval");
|
interval = g_settings_get_uint (keyboard->settings, "repeat-interval");
|
||||||
/* Our setting is in the milliseconds between keys. "rate" is the number
|
/* Our setting is in the milliseconds between keys. "rate" is the number
|
||||||
* of keys per second. */
|
* of keys per second. */
|
||||||
|
if (interval > 0)
|
||||||
rate = (1000 / interval);
|
rate = (1000 / interval);
|
||||||
|
else
|
||||||
|
rate = 0;
|
||||||
|
|
||||||
delay = g_settings_get_uint (keyboard->settings, "delay");
|
delay = g_settings_get_uint (keyboard->settings, "delay");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user