Skip to content

Commit

Permalink
backend: Fix use after free in CBaseBackendFb::DecRef
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Apr 13, 2024
1 parent 39f2779 commit 89cd1ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ namespace gamescope
}
uint32_t CBaseBackendFb::DecRef()
{
wlr_buffer *pClientBuffer = m_pClientBuffer;
uint32_t uRefCount = IBackendFb::DecRef();
if ( m_pClientBuffer && !uRefCount )
if ( pClientBuffer && !uRefCount )
{
wlserver_lock();
wlr_buffer_unlock( m_pClientBuffer );
wlr_buffer_unlock( pClientBuffer );
wlserver_unlock();
}
return uRefCount;
Expand Down

0 comments on commit 89cd1ca

Please sign in to comment.