[client,x11] fix xf_DeleteSurface error branch

This commit is contained in:
Armin Novak
2026-02-17 11:10:16 +01:00
parent df64d00a97
commit c4a0565342

View File

@@ -424,19 +424,20 @@ static UINT xf_DeleteSurface(RdpgfxClientContext* context,
const RDPGFX_DELETE_SURFACE_PDU* deleteSurface)
{
rdpCodecs* codecs = NULL;
xfGfxSurface* surface = NULL;
UINT status = 0;
EnterCriticalSection(&context->mux);
surface = (xfGfxSurface*)context->GetSurfaceData(context, deleteSurface->surfaceId);
xfGfxSurface* surface =
(xfGfxSurface*)context->GetSurfaceData(context, deleteSurface->surfaceId);
if (surface)
{
if (surface->gdi.windowMapped)
{
const UINT rc = IFCALLRESULT(CHANNEL_RC_OK, context->UnmapWindowForSurface, context,
surface->gdi.windowId);
if (rc != CHANNEL_RC_OK)
return rc;
status = IFCALLRESULT(CHANNEL_RC_OK, context->UnmapWindowForSurface, context,
surface->gdi.windowId);
if (status != CHANNEL_RC_OK)
goto fail;
}
#ifdef WITH_GFX_H264
@@ -456,6 +457,7 @@ static UINT xf_DeleteSurface(RdpgfxClientContext* context,
if (codecs && codecs->progressive)
progressive_delete_surface_context(codecs->progressive, deleteSurface->surfaceId);
fail:
LeaveCriticalSection(&context->mux);
return status;
}