From 3a40542aab5a35ae8ae6c44899ffa26a7c7282eb Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Sat, 25 Jun 2022 09:22:11 -0700 Subject: [PATCH] parts: fix bug with INT_MIN in numeral object Use 64-bit integer to avoid overflow when creating numeral for INT_MIN. --- src/parts/parts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parts/parts.c b/src/parts/parts.c index 5164935..3e7e5eb 100644 --- a/src/parts/parts.c +++ b/src/parts/parts.c @@ -577,7 +577,7 @@ static bool parts_numeral_update(struct parts *parts, struct parts_numeral *num) // XXX: don't generate texture if number hasn't been set yet if (!num->have_num) return true; - int n = num->num; + int_least64_t n = num->num; bool negative = n < 0; if (negative) n *= -1;