CComponentsHeader: avoid possible 'out of range' log message

seen during left/right scroll with channellist
This commit is contained in:
2018-01-13 23:35:28 +01:00
parent 22e2b7bcf8
commit 26c552a1ed

View File

@@ -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.