mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-03-24 01:34:04 +00:00
Prohibit negative or zero x/y resolutions
Default resolution is 1, don't allow setting 0 to avoid divisions by 0 or
just general weirdness.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 049611bd7f)
This commit is contained in:
@@ -769,6 +769,16 @@ set_default_parameters(InputInfoPtr pInfo)
|
||||
xf86SetIntOption(opts, "HorizResolution", horizResolution);
|
||||
pars->resolution_vert =
|
||||
xf86SetIntOption(opts, "VertResolution", vertResolution);
|
||||
if (pars->resolution_horiz <= 0) {
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Invalid X resolution, using 1 instead.\n");
|
||||
pars->resolution_horiz = 1;
|
||||
}
|
||||
if (pars->resolution_vert <= 0) {
|
||||
xf86IDrvMsg(pInfo, X_ERROR,
|
||||
"Invalid Y resolution, using 1 instead.\n");
|
||||
pars->resolution_vert = 1;
|
||||
}
|
||||
|
||||
/* Warn about (and fix) incorrectly configured TopEdge/BottomEdge parameters */
|
||||
if (pars->top_edge > pars->bottom_edge) {
|
||||
|
||||
Reference in New Issue
Block a user