mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
- Check buffer sizes and color counts for IOCTL_VIDEO_SET_COLOR_REGISTERS request.
svn path=/trunk/; revision=9464
This commit is contained in:
parent
1c1f4e3945
commit
ed16c950dc
1 changed files with 11 additions and 3 deletions
|
@ -473,9 +473,14 @@ VBEStartIO(
|
|||
break;
|
||||
|
||||
case IOCTL_VIDEO_SET_COLOR_REGISTERS:
|
||||
/*
|
||||
* FIXME: Check buffer size!
|
||||
*/
|
||||
if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT) ||
|
||||
RequestPacket->InputBufferLength <
|
||||
(((PVIDEO_CLUT)RequestPacket->InputBuffer)->NumEntries * sizeof(ULONG)) +
|
||||
sizeof(VIDEO_CLUT))
|
||||
{
|
||||
RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
|
||||
return TRUE;
|
||||
}
|
||||
Result = VBESetColorRegisters(
|
||||
(PVBE_DEVICE_EXTENSION)HwDeviceExtension,
|
||||
(PVIDEO_CLUT)RequestPacket->InputBuffer,
|
||||
|
@ -797,6 +802,9 @@ VBESetColorRegisters(
|
|||
ULONG Entry;
|
||||
PULONG OutputEntry;
|
||||
|
||||
if (ColorLookUpTable->NumEntries + ColorLookUpTable->FirstEntry > 256)
|
||||
return FALSE;
|
||||
|
||||
if (DeviceExtension->VGACompatible)
|
||||
{
|
||||
for (Entry = ColorLookUpTable->FirstEntry;
|
||||
|
|
Loading…
Reference in a new issue