CComponentsHeader: avoid possible 'out of range' log message

seen during left/right scroll with channellist


Origin commit data
------------------
Commit: 17a6df336c
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-03-11 (Sun, 11 Mar 2018)
This commit is contained in:
2018-03-11 21:28:34 +01:00
committed by vanhofen
parent ce99bebb39
commit 6ff6697ead

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.