[hosts] nvfbc: exit loop early if ystart is > then dataHeight

This commit is contained in:
Geoffrey McRae 2023-11-11 09:08:08 +11:00
parent 8630fd20ad
commit cb849b287c

View File

@ -723,8 +723,12 @@ static CaptureResult nvfbc_getFrame(FrameBuffer * frame, int frameIndex)
for (unsigned int y = 0; y < h; ++y) for (unsigned int y = 0; y < h; ++y)
{ {
const unsigned int ystart = y << this->diffShift; const unsigned int ystart = y << this->diffShift;
const unsigned int yend = min(this->dataHeight, (y + 1) if (ystart > this->dataHeight)
<< this->diffShift); break;
const unsigned int yend = min(
this->dataHeight,
(y + 1) << this->diffShift);
for (unsigned int x = 0; x < w; ) for (unsigned int x = 0; x < w; )
{ {