From a455078e0f10853340b8553c8e1719cdb958507e Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 7 Nov 2023 22:30:50 +1100 Subject: [PATCH] [host] dxgi: dont alter the damage rect array when scaling --- host/platform/Windows/capture/DXGI/src/dxgi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/host/platform/Windows/capture/DXGI/src/dxgi.c b/host/platform/Windows/capture/DXGI/src/dxgi.c index 6343a52f..3a6d16e0 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/host/platform/Windows/capture/DXGI/src/dxgi.c @@ -1244,16 +1244,16 @@ static CaptureResult dxgi_capture(void) { for (int i = 0; i < tex->texDamageCount; ++i) { - FrameDamageRect * rect = &tex->texDamageRects[i]; + FrameDamageRect rect = tex->texDamageRects[i]; // correct the damage rect for BGR packed data if (this->outputFormat == CAPTURE_FMT_BGR) { - rect->x = (rect->x * 3 ) / 4; // round down - rect->width = (rect->width * 3 + 3) / 4; // round up + rect.x = (rect.x * 3 ) / 4; // round down + rect.width = (rect.width * 3 + 3) / 4; // round up } - if (!this->backend->copyRect(dst, this->texWIndex, rect)) + if (!this->backend->copyRect(dst, this->texWIndex, &rect)) { result = CAPTURE_RESULT_ERROR; goto exit;