From d480b674ca622f501d02b7e0afc61eceb678d3fb Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 11 Nov 2023 20:37:58 +1100 Subject: [PATCH] [host] dxgi: fix invalid array access via wrong variable --- host/platform/Windows/capture/DXGI/src/d3d12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/platform/Windows/capture/DXGI/src/d3d12.c b/host/platform/Windows/capture/DXGI/src/d3d12.c index d4d85cef..121cb89e 100644 --- a/host/platform/Windows/capture/DXGI/src/d3d12.c +++ b/host/platform/Windows/capture/DXGI/src/d3d12.c @@ -412,7 +412,7 @@ static bool d3d12_preCopy(ID3D11Texture2D * src, unsigned textureIndex) // too many handles to cache, disable the cache entirely for(int i = 0; i < this->sharedCacheCount; ++i) { - struct SharedCache *cache = &this->sharedCache[this->sharedCacheCount++]; + struct SharedCache *cache = &this->sharedCache[i]; comRef_release(cache->d12src); } this->sharedCacheCount = -1;