mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
- Add more check of parametres in GetDIBits
svn path=/trunk/; revision=39882
This commit is contained in:
parent
31c097e8b6
commit
0302c8f272
1 changed files with 12 additions and 3 deletions
|
@ -418,7 +418,13 @@ GetDIBits(
|
|||
}
|
||||
}
|
||||
}
|
||||
pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize);
|
||||
|
||||
if ((ULONG)lpvBits & (sizeof(DWORD) - 1))
|
||||
{
|
||||
pvSafeBits = RtlAllocateHeap(RtlGetProcessHeap(), 0, cjBmpScanSize);
|
||||
if (!pvSafeBits)
|
||||
return Ret;
|
||||
}
|
||||
}
|
||||
|
||||
Ret = NtGdiGetDIBitsInternal(hDC,
|
||||
|
@ -430,9 +436,12 @@ GetDIBits(
|
|||
uUsage,
|
||||
cjBmpScanSize,
|
||||
0);
|
||||
if ( lpvBits != pvSafeBits)
|
||||
if (lpvBits != pvSafeBits)
|
||||
{
|
||||
RtlCopyMemory( lpvBits, pvSafeBits, cjBmpScanSize);
|
||||
if (Ret)
|
||||
{
|
||||
RtlCopyMemory(lpvBits, pvSafeBits, cjBmpScanSize);
|
||||
}
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, pvSafeBits);
|
||||
}
|
||||
return Ret;
|
||||
|
|
Loading…
Reference in a new issue