Check if width, height or start index of a list[] is negative
parent
dae03382bf
commit
6c4a8766ab
|
@ -421,6 +421,12 @@ void GUIFormSpecMenu::parseList(parserData* data,std::string element) {
|
||||||
s32 start_i = 0;
|
s32 start_i = 0;
|
||||||
if(startindex != "")
|
if(startindex != "")
|
||||||
start_i = stoi(startindex);
|
start_i = stoi(startindex);
|
||||||
|
|
||||||
|
if (geom.X < 0 || geom.Y < 0 || start_i < 0) {
|
||||||
|
errorstream<< "Invalid list element: '" << element << "'" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(data->bp_set != 2)
|
if(data->bp_set != 2)
|
||||||
errorstream<<"WARNING: invalid use of list without a size[] element"<<std::endl;
|
errorstream<<"WARNING: invalid use of list without a size[] element"<<std::endl;
|
||||||
m_inventorylists.push_back(ListDrawSpec(loc, listname, pos, geom, start_i));
|
m_inventorylists.push_back(ListDrawSpec(loc, listname, pos, geom, start_i));
|
||||||
|
|
Loading…
Reference in New Issue