mediafoundation: MFTRegisterWorkQueue/MFTUnregisterWorkQueue to validate null param instead of crash
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40860>
This commit is contained in:
Silvio Vilerino 2026-04-07 12:08:00 -04:00 committed by Pohsiang (John) Hsu
parent 6d1b209d0c
commit 4cac78bb3c

View file

@ -290,7 +290,8 @@ MFTRegisterWorkQueue( struct d3d12_context_queue_priority_manager *manager, ID3D
mtx_lock( &mft_mgr->m_lock );
ComPtr<IUnknown> 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<IUnknown> 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;