From 31657fe534bf0de64f75960954a0620877fa7320 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 5 Oct 2020 23:16:34 +0200 Subject: [PATCH] Defense --- radio/src/thirdparty/libopenui/src/roller.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/radio/src/thirdparty/libopenui/src/roller.h b/radio/src/thirdparty/libopenui/src/roller.h index 2a44db723..608eab033 100644 --- a/radio/src/thirdparty/libopenui/src/roller.h +++ b/radio/src/thirdparty/libopenui/src/roller.h @@ -70,6 +70,9 @@ class Roller: public Choice { int32_t value = getValue(); auto valuesCount = getValuesCount(); + if (valuesCount == 0) { + return; + } int index = (scrollPositionY - ROLLER_LINE_HEIGHT + 1) / ROLLER_LINE_HEIGHT; coord_t y = index * ROLLER_LINE_HEIGHT;