mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +00:00
[WIN32K]
Fix the hack, so it doesn't cause overwriting of usermode memory. svn path=/trunk/; revision=57445
This commit is contained in:
parent
aec6311fb5
commit
bdd3db1d3d
1 changed files with 3 additions and 2 deletions
|
@ -1007,6 +1007,7 @@ NtGdiGetDIBitsInternal(
|
|||
PBITMAPINFO pbmi;
|
||||
HANDLE hSecure = NULL;
|
||||
INT iResult = 0;
|
||||
UINT cjAlloc;
|
||||
|
||||
/* Check for bad iUsage */
|
||||
if (iUsage > 2) return 0;
|
||||
|
@ -1022,10 +1023,10 @@ NtGdiGetDIBitsInternal(
|
|||
|
||||
// HACK: the underlying code sucks and doesn't care for the size, so we
|
||||
// give it the maximum ever needed
|
||||
cjMaxInfo = sizeof(BITMAPV5HEADER) + 256 * sizeof(RGBQUAD);
|
||||
cjAlloc = sizeof(BITMAPV5HEADER) + 256 * sizeof(RGBQUAD);
|
||||
|
||||
/* Allocate a buffer the bitmapinfo */
|
||||
pbmi = ExAllocatePoolWithTag(PagedPool, cjMaxInfo, 'imBG');
|
||||
pbmi = ExAllocatePoolWithTag(PagedPool, cjAlloc, 'imBG');
|
||||
if (!pbmi)
|
||||
{
|
||||
/* Fail */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue