diff --git a/src/gallium/frontends/mediafoundation/mfd3dmanager.cpp b/src/gallium/frontends/mediafoundation/mfd3dmanager.cpp index d0ccc85bd7f..f42f58f00e0 100644 --- a/src/gallium/frontends/mediafoundation/mfd3dmanager.cpp +++ b/src/gallium/frontends/mediafoundation/mfd3dmanager.cpp @@ -290,7 +290,8 @@ MFTRegisterWorkQueue( struct d3d12_context_queue_priority_manager *manager, ID3D mtx_lock( &mft_mgr->m_lock ); ComPtr queue_unknown; - if( FAILED( queue->QueryInterface( IID_PPV_ARGS( &queue_unknown ) ) ) ) + if( !queue || + FAILED( queue->QueryInterface( IID_PPV_ARGS( &queue_unknown ) ) ) ) { mtx_unlock( &mft_mgr->m_lock ); return -1; @@ -318,7 +319,8 @@ MFTUnregisterWorkQueue( struct d3d12_context_queue_priority_manager *manager, ID mtx_lock( &mft_mgr->m_lock ); ComPtr queue_unknown; - if( FAILED( queue->QueryInterface( IID_PPV_ARGS( &queue_unknown ) ) ) ) + if( !queue || + FAILED( queue->QueryInterface( IID_PPV_ARGS( &queue_unknown ) ) ) ) { mtx_unlock( &mft_mgr->m_lock ); return -1;