Fix buffer size checks for IOCTL_VIDEO_SET_COLOR_REGISTERS.
Modified: trunk/reactos/drivers/video/miniport/vbe/vbemp.c
Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.c

Modified: trunk/reactos/drivers/video/miniport/vbe/vbemp.c
--- trunk/reactos/drivers/video/miniport/vbe/vbemp.c	2005-06-07 15:13:14 UTC (rev 15828)
+++ trunk/reactos/drivers/video/miniport/vbe/vbemp.c	2005-06-07 16:26:14 UTC (rev 15829)
@@ -480,7 +480,7 @@
          if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
              RequestPacket->InputBufferLength <
              (((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
-             sizeof(VIDEO_CLUT))
+             FIELD_OFFSET(VIDEO_CLUT, LookupTable))
          {
             RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
             return TRUE;

Modified: trunk/reactos/drivers/video/miniport/vga/vgamp.c
--- trunk/reactos/drivers/video/miniport/vga/vgamp.c	2005-06-07 15:13:14 UTC (rev 15828)
+++ trunk/reactos/drivers/video/miniport/vga/vgamp.c	2005-06-07 16:26:14 UTC (rev 15829)
@@ -223,7 +223,7 @@
       if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
           RequestPacket->InputBufferLength <
           (((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
-          sizeof(VIDEO_CLUT))
+          FIELD_OFFSET(VIDEO_CLUT, LookupTable))
       {
         RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
         return TRUE;