mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-05 15:30:00 +01:00
BugFix prevent out-of-bounds access in settings
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
#include "Toolkit/tinyxml2Toolkit.h"
|
#include "Toolkit/tinyxml2Toolkit.h"
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
@@ -732,7 +733,10 @@ void Settings::Load(const std::string &filename)
|
|||||||
{
|
{
|
||||||
glm::vec2 val;
|
glm::vec2 val;
|
||||||
tinyxml2::XMLElementToGLM( strengthNode, val);
|
tinyxml2::XMLElementToGLM( strengthNode, val);
|
||||||
application.mouse_pointer_strength[ (size_t) ceil(val.x) ] = val.y;
|
size_t i = (size_t) ceil(val.x);
|
||||||
|
if (i >= application.mouse_pointer_strength.size())
|
||||||
|
application.mouse_pointer_strength.resize(i + 1, 0.f);
|
||||||
|
application.mouse_pointer_strength[ i ] = val.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user