Author: aandrejevic
Date: Mon Sep 28 18:55:26 2015
New Revision: 69408
URL:
http://svn.reactos.org/svn/reactos?rev=69408&view=rev
Log:
[NTVDM]
Fix a division-by-zero problem by storing the mouse driver's Width and Height
in DWORDs, thus avoiding the integer overflow which could make them zero.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/mouse32.c [iso-8859-1] Mon Sep 28 18:55:26
2015
@@ -211,8 +211,8 @@
static VOID ToMouseCoordinates(PCOORD Position)
{
COORD Resolution = VgaGetDisplayResolution();
- WORD Width = DriverState.MaxX - DriverState.MinX + 1;
- WORD Height = DriverState.MaxY - DriverState.MinY + 1;
+ DWORD Width = DriverState.MaxX - DriverState.MinX + 1;
+ DWORD Height = DriverState.MaxY - DriverState.MinY + 1;
if (!VgaGetDoubleVisionState(NULL, NULL))
{
@@ -227,8 +227,8 @@
static VOID FromMouseCoordinates(PCOORD Position)
{
COORD Resolution = VgaGetDisplayResolution();
- WORD Width = DriverState.MaxX - DriverState.MinX + 1;
- WORD Height = DriverState.MaxY - DriverState.MinY + 1;
+ DWORD Width = DriverState.MaxX - DriverState.MinX + 1;
+ DWORD Height = DriverState.MaxY - DriverState.MinY + 1;
if (!VgaGetDoubleVisionState(NULL, NULL))
{