diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index ec5044fc..3fe379c3 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -723,8 +723,12 @@ static CaptureResult nvfbc_getFrame(FrameBuffer * frame, int frameIndex) for (unsigned int y = 0; y < h; ++y) { const unsigned int ystart = y << this->diffShift; - const unsigned int yend = min(this->dataHeight, (y + 1) - << this->diffShift); + if (ystart > this->dataHeight) + break; + + const unsigned int yend = min( + this->dataHeight, + (y + 1) << this->diffShift); for (unsigned int x = 0; x < w; ) {