web_browser: Add bounds checking to applet interface

This commit is contained in:
Zach Hilman
2018-12-28 18:20:29 -05:00
parent ef4c4e239d
commit cb930c4b5a
10 changed files with 160 additions and 146 deletions

View File

@ -638,10 +638,8 @@ void Controller_NPad::ClearAllControllers() {
});
}
u32 Controller_NPad::GetPressState() {
const auto res = press_state;
press_state = 0;
return res;
u32 Controller_NPad::GetAndResetPressState() {
return std::exchange(press_state, 0);
}
bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {

View File

@ -126,7 +126,7 @@ public:
// Logical OR for all buttons presses on all controllers
// Specifically for cheat engine and other features.
u32 GetPressState();
u32 GetAndResetPressState();
static std::size_t NPadIdToIndex(u32 npad_id);
static u32 IndexToNPad(std::size_t index);