mirror of
https://github.com/reactos/reactos.git
synced 2025-05-01 03:29:37 +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;
|
INT ret = 0;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PDC pDC;
|
PDC pDC = NULL;
|
||||||
HBITMAP hSourceBitmap = NULL, hMaskBitmap = NULL;
|
HBITMAP hSourceBitmap = NULL, hMaskBitmap = NULL;
|
||||||
SURFOBJ *pDestSurf, *pSourceSurf = NULL, *pMaskSurf = NULL;
|
SURFOBJ *pDestSurf, *pSourceSurf = NULL, *pMaskSurf = NULL;
|
||||||
SURFACE *pSurf;
|
SURFACE *pSurf;
|
||||||
|
@ -493,21 +493,25 @@ NtGdiSetDIBitsToDeviceInternal(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
goto Exit2;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
|
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
|
||||||
|
if (ScanLines == 0)
|
||||||
|
{
|
||||||
|
DPRINT1("ScanLines == 0\n");
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
pDC = DC_LockDc(hDC);
|
pDC = DC_LockDc(hDC);
|
||||||
if (!pDC)
|
if (!pDC)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||||
goto Exit2;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDC->dctype == DC_TYPE_INFO)
|
if (pDC->dctype == DC_TYPE_INFO)
|
||||||
{
|
{
|
||||||
DC_UnlockDc(pDC);
|
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -637,14 +641,13 @@ Exit:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
|
if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
|
||||||
|
|
||||||
if (pSourceSurf) EngUnlockSurface(pSourceSurf);
|
if (pSourceSurf) EngUnlockSurface(pSourceSurf);
|
||||||
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
|
if (hSourceBitmap) EngDeleteSurface((HSURF)hSourceBitmap);
|
||||||
if (pMaskSurf) EngUnlockSurface(pMaskSurf);
|
if (pMaskSurf) EngUnlockSurface(pMaskSurf);
|
||||||
if (hMaskBitmap) EngDeleteSurface((HSURF)hMaskBitmap);
|
if (hMaskBitmap) EngDeleteSurface((HSURF)hMaskBitmap);
|
||||||
DC_UnlockDc(pDC);
|
if (pDC) DC_UnlockDc(pDC);
|
||||||
Exit2:
|
|
||||||
ExFreePoolWithTag(pbmiSafe, 'pmTG');
|
ExFreePoolWithTag(pbmiSafe, 'pmTG');
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue