Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Created December 9, 2013 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilzAdam/7881433 to your computer and use it in GitHub Desktop.
Save PilzAdam/7881433 to your computer and use it in GitHub Desktop.
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 920a7f1..82def74 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -421,6 +421,12 @@ void GUIFormSpecMenu::parseList(parserData* data,std::string element) {
s32 start_i = 0;
if(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)
errorstream<<"WARNING: invalid use of list without a size[] element"<<std::endl;
m_inventorylists.push_back(ListDrawSpec(loc, listname, pos, geom, start_i));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment