From fb0dc47e35c06a790109b5c59094170ed7ee3e0b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 13 Apr 2017 23:28:35 +0200 Subject: [PATCH] CComponentsFooter: avoid crash because possible divisions by 0 --- src/gui/components/cc_frm_footer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 853b4465a..3532e05f3 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -111,6 +111,9 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con if (chain) chain->clear(); + if (label_count == 0) + return; + /* set general available full basic space for button chain, * in this case this is footer width */ @@ -372,7 +375,6 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->setButtonFont(font); this->setContextButton(context_buttons); this->setButtonLabels(content, label_count, 0, label_width); - this->paint(do_save_bg); }