mirror of
https://github.com/reactos/reactos.git
synced 2024-11-19 13:33:42 +00:00
[NTVDM]
Fix the range check in VgaReadMemory and VgaWriteMemory. svn path=/trunk/; revision=67238
This commit is contained in:
parent
bfd1c2a6b9
commit
6381155e6c
1 changed files with 2 additions and 2 deletions
|
@ -1910,7 +1910,7 @@ VOID NTAPI VgaReadMemory(ULONG Address, PVOID Buffer, ULONG Size)
|
|||
PUCHAR BufPtr = (PUCHAR)Buffer;
|
||||
|
||||
DPRINT("VgaReadMemory: Address 0x%08X, Size %lu\n", Address, Size);
|
||||
Address = max(min(Address, VgaGetVideoLimitAddress() - 1), VgaGetVideoBaseAddress());
|
||||
Address = min(max(Address, VgaGetVideoLimitAddress() - 1), VgaGetVideoBaseAddress());
|
||||
Size = min(Size, VgaGetVideoLimitAddress() - Address + 1);
|
||||
|
||||
/* Ignore if video RAM access is disabled */
|
||||
|
@ -1939,7 +1939,7 @@ BOOLEAN NTAPI VgaWriteMemory(ULONG Address, PVOID Buffer, ULONG Size)
|
|||
PUCHAR BufPtr = (PUCHAR)Buffer;
|
||||
|
||||
DPRINT("VgaWriteMemory: Address 0x%08X, Size %lu\n", Address, Size);
|
||||
Address = max(min(Address, VgaGetVideoLimitAddress() - 1), VgaGetVideoBaseAddress());
|
||||
Address = min(max(Address, VgaGetVideoLimitAddress() - 1), VgaGetVideoBaseAddress());
|
||||
Size = min(Size, VgaGetVideoLimitAddress() - Address + 1);
|
||||
|
||||
/* Ignore if video RAM access is disabled */
|
||||
|
|
Loading…
Reference in a new issue