mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
-fix possible segfault if ID value is bigger than MN_WIDGET_ID_MAX
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1927 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -332,7 +332,15 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg
|
|||||||
iconfile = Icon;
|
iconfile = Icon;
|
||||||
|
|
||||||
//handle select values
|
//handle select values
|
||||||
|
if(w_index > MN_WIDGET_ID_MAX){
|
||||||
|
//error
|
||||||
|
fprintf(stderr, "Warning: %s Index ID value (%i) is bigger than MN_WIDGET_ID_MAX (%i) \n", __FUNCTION__,w_index,MN_WIDGET_ID_MAX );
|
||||||
|
widget_index = NO_WIDGET_ID;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
//ok
|
||||||
widget_index = w_index;
|
widget_index = w_index;
|
||||||
|
}
|
||||||
preselected = NO_WIDGET_ID;
|
preselected = NO_WIDGET_ID;
|
||||||
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user