From 8df6d0dfae8c2f1ef617058217c417357258f04e Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 22 Nov 2023 13:43:29 -0800 Subject: til_fb: remove asserts from til_fb_fragment_copy() If a caller wants to rely heavily on til_fb_fragment_copy() for clipping, it'll be normal for situations like zero or negative W/H of the clipped area. Those would just be zero copy scenarios, so simply return instead of asserting. --- src/til_fb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/til_fb.h b/src/til_fb.h index 9daef63..af17025 100644 --- a/src/til_fb.h +++ b/src/til_fb.h @@ -142,7 +142,8 @@ static inline void til_fb_fragment_copy(til_fb_fragment_t *dest, uint32_t flags, int W = MIN(MIN(dest->x + dest->width, src->x + src->width), x + width) - X; int H = MIN(MIN(dest->y + dest->height, src->y + src->height), y + height) - Y; - assert(W >= 0 && H >= 0); + if (W <= 0 || H <= 0) + return; /* XXX FIXME TODO */ /* XXX FIXME TODO */ -- cgit v1.2.1