aboutsummaryrefslogtreecommitdiffstats
path: root/lines.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-02-08 22:07:36 +0100
committerMattias Andrée <maandree@kth.se>2023-02-08 22:07:36 +0100
commit73184638615c27a4e190c6a902a2f29729ee45ff (patch)
tree48195415c773990d48c24ffc6d708f54c95bdba3 /lines.c
parentTest lines.c (diff)
downloadlibrifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-73184638615c27a4e190c6a902a2f29729ee45ff.tar.gz
librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-73184638615c27a4e190c6a902a2f29729ee45ff.tar.bz2
librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-73184638615c27a4e190c6a902a2f29729ee45ff.tar.xz
Fix out of bounds error in drawing of vertical lines
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--lines.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lines.c b/lines.c
index d43c7fe..4ac624a 100644
--- a/lines.c
+++ b/lines.c
@@ -50,6 +50,8 @@ draw_vertical_line(RASTER *restrict raster, double x1, double y1, double y2, int
start = (size_t)y1;
end = (size_t)y2;
+ start -= (size_t)(start == raster->height);
+ end -= (size_t)(end == raster->height);
y = start;
if (ydir > 0) {