From 81370ba3119838e8077d8e0f5047f7e56e9d6826 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 14 Apr 2021 08:23:17 -0400 Subject: [PATCH] [sixel_delete] don't scribble beyond pile rendering vector #1534 --- src/lib/sixel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/sixel.c b/src/lib/sixel.c index cc32922ca..6d978b9f9 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -505,8 +505,8 @@ int sixel_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){ //fprintf(stderr, "%d] %d %p\n", s->id, s->invalidated, s->n); (void)nc; (void)out; - for(int yy = s->movedfromy ; yy < s->movedfromy + s->dimy ; ++yy){ - for(int xx = s->movedfromx ; xx < s->movedfromx + s->dimx ; ++xx){ + for(int yy = s->movedfromy ; yy < s->movedfromy + s->dimy && yy < p->dimy ; ++yy){ + for(int xx = s->movedfromx ; xx < s->movedfromx + s->dimx && xx < p->dimx ; ++xx){ struct crender *r = &p->crender[yy * p->dimx + xx]; if(!r->sprixel){ r->s.damaged = 1;