ui/vnc-jobs: assert rect coordinates and dimensions in vnc_job_add_rect

All callers guarantee non-negative coordinates and positive
dimensions. Add an assert to document the invariant that
vnc_worker_clamp_rect relies on.

Reported-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20261004-issue-4560-v1-18-ccbef537cbeb@redhat.com>
This commit is contained in:
Marc-André Lureau committed 2026-10-13 17:22:49 +04:00
1 parent 8517fb7f3c
commit 5ab4518ce8
1 file changed
+1
+1
View File
@@ -87,6 +87,7 @@ int vnc_job_add_rect(VncJob *job, int x, int y, int w, int h)
trace_vnc_job_add_rect(job->vs, job, x, y, w, h); trace_vnc_job_add_rect(job->vs, job, x, y, w, h);
assert(!QTAILQ_IN_USE(job, next)); assert(!QTAILQ_IN_USE(job, next));
assert(x >= 0 && y >= 0 && w > 0 && h > 0);
entry->rect.x = x; entry->rect.x = x;
entry->rect.y = y; entry->rect.y = y;