- IntGetDeviceGammaRamp: remove unneeded code, i * 256 is always smaller than 65535 (255*256=65280 is the biggest value), CID 35

- IntSetDeviceGammaRamp: don't copy data to NULL buffer, CID 195

svn path=/trunk/; revision=37944
This commit is contained in:
Gregor Schneider 2008-12-08 19:44:13 +00:00
parent e20af6d632
commit e9c0e48377

View file

@ -118,7 +118,6 @@ IntGetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp)
for(i=0; i<256; i++ )
{
int NewValue = i * 256;
if (NewValue > 65535) NewValue = 65535;
Ramp->Red[i] = Ramp->Green[i] = Ramp->Blue[i] = ((WORD)NewValue);
}
@ -350,7 +349,8 @@ IntSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Test)
pGDev->pvGammaRamp = ExAllocatePoolWithTag(PagedPool, sizeof(GAMMARAMP), TAG_GDIICM);
pGDev->flFlags |= PDEV_GAMMARAMP_TABLE;
}
RtlCopyMemory( pGDev->pvGammaRamp, Ramp, sizeof(GAMMARAMP));
if (pGDev->pvGammaRamp)
RtlCopyMemory( pGDev->pvGammaRamp, Ramp, sizeof(GAMMARAMP));
Ret = UpdateDeviceGammaRamp(hPDev);