Commit 2afd2f70 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Avoid accessing free'd memory on an error path in ddraw_surface_create().

parent 62e25379
......@@ -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;
}
}
......
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