mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[vendor] fixed out of bounds memory access on negative pointer offsets
This commit is contained in:
parent
ffd2fc1824
commit
dfa2a5809a
4
vendor/DXGICapture/DXGIManager.cpp
vendored
4
vendor/DXGICapture/DXGIManager.cpp
vendored
@ -562,9 +562,9 @@ void DXGIManager::DrawMousePointer(BYTE* pDesktopBits, RECT rcDesktop, RECT rcDe
|
||||
// alpha blend the cursor
|
||||
const int maxX = min(shapeInfo.Width , dwDesktopWidth - PtrX);
|
||||
const int maxY = min(shapeInfo.Height, dwDesktopHeight - PtrY);
|
||||
for(int y = 0; y < maxY; ++y)
|
||||
for(int y = abs(min(0, PtrY)); y < maxY; ++y)
|
||||
{
|
||||
for (int x = 0; x < maxX; ++x)
|
||||
for (int x = abs(min(0, PtrX)); x < maxX; ++x)
|
||||
{
|
||||
BYTE *srcPix = &PtrBuf[y * shapeInfo.Pitch + x * 4];
|
||||
BYTE *dstPix = &pDesktopBits[((PtrY + y) * dwDesktopWidth * 4) + (PtrX + x) * 4];
|
||||
|
Loading…
Reference in New Issue
Block a user