From 534c105a7a4f5c60f45242eeaeb03657c759af25 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 5 Aug 2019 18:02:29 -0700 Subject: [PATCH] Fix 16-bit range check in TMenuItem::action_edit (#14834) --- Marlin/src/lcd/menu/menu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 781c87615d..b1b2bba162 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -191,8 +191,8 @@ class TMenuItem : MenuItemBase { public: static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=nullptr, const bool live=false) { // Make sure minv and maxv fit within int16_t - const int32_t minv = _MAX(scale(minValue), INT_MIN), - maxv = _MIN(scale(maxValue), INT_MAX); + const int32_t minv = _MAX(scale(minValue), INT16_MIN), + maxv = _MIN(scale(maxValue), INT16_MAX); init(pstr, ptr, minv, maxv - minv, scale(*ptr) - minv, edit, callback, live); } static void edit() { MenuItemBase::edit(to_string, load); }