Return NULL, if failed to lock the provided palette in InrEngCreateXlate. Fixes bug 4378.

See issue #4378 for more details.

svn path=/trunk/; revision=40502
This commit is contained in:
Timo Kreuzer 2009-04-14 16:06:07 +00:00
parent e05f6c1a3e
commit b4c029b29e

View file

@ -177,9 +177,23 @@ IntEngCreateXlate(USHORT DestPalType, USHORT SourcePalType,
DestPalGDI = PALETTE_LockPalette(PaletteDest);
if (SourcePalType == 0)
{
if (!SourcePalGDI)
{
DPRINT1("Failed to lock source palette %p\n", PaletteSource);
return NULL;
}
SourcePalType = SourcePalGDI->Mode;
}
if (DestPalType == 0)
{
if (!DestPalGDI)
{
DPRINT1("Failed to lock dest palette %p\n", PaletteDest);
return NULL;
}
DestPalType = DestPalGDI->Mode;
}
XlateObj->iSrcType = SourcePalType;
XlateObj->iDstType = DestPalType;