summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-07-15 20:07:55 +0000
committerrodri <rgl@antares-labs.eu>2024-07-15 20:07:55 +0000
commit05e63a30ce73bbb09b60cd7943e34145351f9055 (patch)
treec21270d847d63dfa9ba73b3353bb917e09178ea9
parent178db63ff74f35a845758b69399bcb257d77468f (diff)
download3dee-05e63a30ce73bbb09b60cd7943e34145351f9055.tar.gz
3dee-05e63a30ce73bbb09b60cd7943e34145351f9055.tar.bz2
3dee-05e63a30ce73bbb09b60cd7943e34145351f9055.zip
vis: don't allow peeking outside the framebuffer.
-rw-r--r--vis.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index 1d9b4b2..c4ceb7c 100644
--- a/vis.c
+++ b/vis.c
@@ -597,6 +597,8 @@ lmb(void)
p₂ = Pt2(p.x, p.y, 1);
p₂ = rframexform(p₂, *maincam->view);
p = Pt(p₂.x, p₂.y);
+ if(!ptinrect(p, maincam->view->r))
+ return;
qlock(maincam->view->fbctl);
fb = maincam->view->getfb(maincam->view);
c = ul2col(fb->cb[p.y*Dx(fb->r) + p.x]);