From ecd3692e1e76c1ca9d89854af5343a92eba030e1 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 4 Apr 2024 22:43:46 +1100 Subject: [PATCH] [host] dxgi: fix crash during init due to out of order accesses --- .../platform/Windows/capture/DXGI/src/pp/sdrwhitelevel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/host/platform/Windows/capture/DXGI/src/pp/sdrwhitelevel.c b/host/platform/Windows/capture/DXGI/src/pp/sdrwhitelevel.c index 731e3ff3..1a3b43ea 100644 --- a/host/platform/Windows/capture/DXGI/src/pp/sdrwhitelevel.c +++ b/host/platform/Windows/capture/DXGI/src/pp/sdrwhitelevel.c @@ -78,8 +78,8 @@ static bool sdrWhiteLevel_setup( this.context = context; this.shareable = shareable; - comRef_initGlobalScope(10, this.comScope); - comRef_scopePush(10); + comRef_initGlobalScope(11, this.comScope); + comRef_scopePush(11); comRef_defineLocal(IDXGIOutput6, output6); status = IDXGIOutput_QueryInterface( @@ -174,11 +174,12 @@ static bool sdrWhiteLevel_setup( goto exit; } + comRef_toGlobal(this.sampler, sampler); + comRef_toGlobal(this.buffer , buffer ); + updateConsts(); DEBUG_INFO("SDR White Level : %f" , this.sdrWhiteLevel); - comRef_toGlobal(this.sampler, sampler); - comRef_toGlobal(this.buffer , buffer ); result = true; exit: