mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[WIN32K]
NtGdiSetDIBitsToDeviceInternal: Check for ScanLines == 0 and clean up exit pathes. Fixes assertion failure in gdi32_winetest:bitmap svn path=/trunk/; revision=66612
This commit is contained in:
parent
ff14566384
commit
cdc2efb241
1 changed files with 10 additions and 7 deletions
|
@ -461,7 +461,7 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
{
|
||||
INT ret = 0;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PDC pDC;
|
||||
PDC pDC = NULL;
|
||||
HBITMAP hSourceBitmap = NULL, hMaskBitmap = NULL;
|
||||
SURFOBJ *pDestSurf, *pSourceSurf = NULL, *pMaskSurf = NULL;
|
||||
SURFACE *pSurf;
|
||||
|
@ -493,21 +493,25 @@ NtGdiSetDIBitsToDeviceInternal(
|
|||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
goto Exit2;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
|
||||
if (ScanLines == 0)
|
||||
{
|
||||
DPRINT1("ScanLines == 0\n");
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
pDC = DC_LockDc(hDC);
|
||||
if (!pDC)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
goto Exit2;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if (pDC->dctype == DC_TYPE_INFO)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
@ -637,14 +641,13 @@ Exit:
|
|||
}
|
||||
|
||||
if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
|
||||
|
||||
if (pSourceSurf) EngUnlockSurface(pSourceSurf);
|
||||
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
|
||||
if (pMaskSurf) EngUnlockSurface(pMaskSurf);
|
||||
if (hMaskBitmap) EngDeleteSurface((HSURF)hMaskBitmap);
|
||||
DC_UnlockDc(pDC);
|
||||
Exit2:
|
||||
if (pDC) DC_UnlockDc(pDC);
|
||||
ExFreePoolWithTag(pbmiSafe, 'pmTG');
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue