[common] rects: validate copy geometry

This commit is contained in:
Geoffrey McRae
2026-08-24 12:59:55 +10:00
parent b78b92a53f
commit 8336a27192
4 changed files with 124 additions and 51 deletions

View File

@@ -1551,13 +1551,19 @@ static CaptureResult dxgi_getFrame(
scaledDamageRects[i] = rect;
}
rectsBufferToFramebuffer(scaledDamageRects, damage->count, this->bpp, frame,
this->pitch, this->dataHeight, tex->map, this->pitch);
if (!rectsBufferToFramebuffer(scaledDamageRects, damage->count,
this->bpp, frame, this->pitch, this->dataHeight,
tex->map, this->pitch))
framebuffer_write(frame, tex->map,
this->pitch * this->dataHeight);
}
else
{
rectsBufferToFramebuffer(damage->rects, damage->count, this->bpp, frame,
this->pitch, this->dataHeight, tex->map, this->pitch);
if (!rectsBufferToFramebuffer(damage->rects, damage->count,
this->bpp, frame, this->pitch, this->dataHeight,
tex->map, this->pitch))
framebuffer_write(frame, tex->map,
this->pitch * this->dataHeight);
}
}
}