Skip to content

Commit c2fecc5

Browse files
digetxmisyltoad
authored andcommitted
DRMBackend: Fix NULL dereference in drm_prepare_liftoff()
Fix gamescope crashing with a NULL dereference in drm_prepare_liftoff(). Fixes: 8f82d51 ("backend: Add support for deferred backends") Signed-off-by: Dmitry Osipenko <[email protected]>
1 parent fbe1667 commit c2fecc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Backends/DRMBackend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ drm_prepare_liftoff( struct drm_t *drm, const struct FrameInfo_t *frameInfo, boo
25612561
if ( i < frameInfo->layerCount )
25622562
{
25632563
const FrameInfo_t::Layer_t *pLayer = &frameInfo->layers[ i ];
2564-
gamescope::CDRMFb *pDrmFb = static_cast<gamescope::CDRMFb *>( pLayer->tex ? pLayer->tex->GetBackendFb()->Unwrap() : nullptr );
2564+
gamescope::CDRMFb *pDrmFb = static_cast<gamescope::CDRMFb *>( (pLayer->tex && pLayer->tex->GetBackendFb()) ? pLayer->tex->GetBackendFb()->Unwrap() : nullptr );
25652565

25662566
if ( pDrmFb == nullptr )
25672567
{

0 commit comments

Comments
 (0)