ddraw: Avoid accessing free'd memory on an error path in ddraw_surface_create().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
62e253796e
commit
2afd2f705f
|
@ -5754,10 +5754,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
|||
if (desc->dwFlags & DDSD_BACKBUFFERCOUNT)
|
||||
{
|
||||
WARN("Tried to specify a back buffer count for a non-flippable surface.\n");
|
||||
hr = desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP ? DDERR_INVALIDPARAMS : DDERR_INVALIDCAPS;
|
||||
HeapFree(GetProcessHeap(), 0, texture);
|
||||
if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
return DDERR_INVALIDCAPS;
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue