wined3d: Compare and copy the actual palette in palette9_changed() (Valgrind).

This commit is contained in:
Henri Verbeet 2009-10-23 10:26:12 +02:00 committed by Alexandre Julliard
parent 53104ac1e7
commit ade350b4d4
1 changed files with 5 additions and 3 deletions

View File

@ -2516,14 +2516,16 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This) {
return FALSE;
}
if(This->palette9) {
if(memcmp(This->palette9, &device->palettes[device->currentPalette], sizeof(PALETTEENTRY) * 256) == 0) {
if (This->palette9)
{
if (!memcmp(This->palette9, device->palettes[device->currentPalette], sizeof(PALETTEENTRY) * 256))
{
return FALSE;
}
} else {
This->palette9 = HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY) * 256);
}
memcpy(This->palette9, &device->palettes[device->currentPalette], sizeof(PALETTEENTRY) * 256);
memcpy(This->palette9, device->palettes[device->currentPalette], sizeof(PALETTEENTRY) * 256);
return TRUE;
}