Commit 644724d3 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Just return an error if we failed to find the predecessor in…

ddraw: Just return an error if we failed to find the predecessor in ddraw_surface_delete_attached_surface(). Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 130bd9d8
......@@ -1982,16 +1982,16 @@ static HRESULT ddraw_surface_delete_attached_surface(struct ddraw_surface *surfa
}
/* Find the predecessor of the detached surface */
while (prev)
while (prev->next_attached != attachment)
{
if (prev->next_attached == attachment)
break;
prev = prev->next_attached;
if (!(prev = prev->next_attached))
{
ERR("Failed to find predecessor of %p.\n", attachment);
wined3d_mutex_unlock();
return DDERR_SURFACENOTATTACHED;
}
}
/* There must be a surface, otherwise there's a bug */
assert(prev);
/* Unchain the surface */
prev->next_attached = attachment->next_attached;
attachment->next_attached = NULL;
......
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