From 26c552a1edef8af6956e2143a0a8cbfa87e47ae9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 13 Jan 2018 23:35:28 +0100 Subject: [PATCH] CComponentsHeader: avoid possible 'out of range' log message seen during left/right scroll with channellist --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 471ed6827..868486717 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -302,7 +302,7 @@ void CComponentsHeader::initLogo() */ int logo_id = getCCItemId(cch_logo_obj); CComponentsItem *prev_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 2 : logo_id - 1); - CComponentsItem *next_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 1 : logo_id + 1); + CComponentsItem *next_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 1 : min(logo_id + 1, (int)size()-1)); /* * FIXME: Workaround to fix next item in case of wrong order of items.