From 11ba8e7af03ce748e1638de2dd7511165ded398c Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Thu, 16 Dec 2021 04:00:49 -0600 Subject: [PATCH] 3.1.1 bugfix out of bounds --- pixie.nimble | 2 +- src/pixie/images.nim | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pixie.nimble b/pixie.nimble index abe6edb..85a8301 100644 --- a/pixie.nimble +++ b/pixie.nimble @@ -1,4 +1,4 @@ -version = "3.1.0" +version = "3.1.1" author = "Andre von Houck and Ryan Oldenburg" description = "Full-featured 2d graphics library for Nim." license = "MIT" diff --git a/src/pixie/images.nim b/src/pixie/images.nim index de63539..e2c3e8c 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -750,6 +750,10 @@ proc drawUber( xStart = xStart.clamp(0, a.width) xStop = xStop.clamp(0, a.width) + # Skip this row if there is nothing in-bounds to draw + if xStart == a.width or xStop == 0: + continue + if blendMode == bmMask: if xStart > 0: zeroMem(a.data[a.dataIndex(0, y)].addr, 4 * xStart)