Restrict nTimeout to 0-32767, since it is a 16bit value in X.

oldstable
Marcus Meissner 2000-06-23 16:49:46 +00:00 committed by Alexandre Julliard
parent 52b6bd95d3
commit 398d8b4e9b
1 changed files with 3 additions and 0 deletions

View File

@ -413,6 +413,9 @@ int X11DRV_GetScreenSaveTimeout(void)
*/
void X11DRV_SetScreenSaveTimeout(int nTimeout)
{
/* timeout is a 16bit entity (CARD16) in the protocol, so it should
* not get over 32767 or it will get negative. */
if (nTimeout>32767) nTimeout = 32767;
TSXSetScreenSaver(display, nTimeout, 60, DefaultBlanking, DefaultExposures);
}