Commit ed44f9d1 authored by Alexander Dorofeyev's avatar Alexander Dorofeyev Committed by Alexandre Julliard

ddraw: Fix palette handling in IDirect3DTexture_Load.

This fixes a potential refcounting problem and makes the function fail with NULL destination texture's palette and non-NULL source palette like it does on native.
parent ddd0ec16
......@@ -365,15 +365,11 @@ IDirect3DTextureImpl_Load(IDirect3DTexture2 *iface,
}
}
/* After seeing some logs, not sure at all about this... */
if (pal == NULL)
{
IWineD3DSurface_SetPalette(This->WineD3DSurface, wine_pal);
if (pal_src != NULL) IDirectDrawPalette_AddRef(pal_src);
}
else if (pal_src != NULL)
if (pal_src != NULL)
{
PALETTEENTRY palent[256];
if (pal == NULL) return DDERR_NOPALETTEATTACHED;
IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment