mirror of
https://github.com/Maschell/controller_patcher.git
synced 2024-11-22 03:59:16 +01:00
Adding more checks for NULL-Pointer
This commit is contained in:
parent
41012b4543
commit
bb6964cd6f
@ -747,6 +747,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::gettingInputAllDevices(Inp
|
|||||||
}
|
}
|
||||||
|
|
||||||
CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setProControllerDataFromHID(void * data,s32 chan, s32 mode){
|
CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setProControllerDataFromHID(void * data,s32 chan, s32 mode){
|
||||||
|
if(data == NULL) return CONTROLLER_PATCHER_ERROR_NULL_POINTER;
|
||||||
if(chan < 0 || chan > 3) return CONTROLLER_PATCHER_ERROR_INVALID_CHAN;
|
if(chan < 0 || chan > 3) return CONTROLLER_PATCHER_ERROR_INVALID_CHAN;
|
||||||
//if(gControllerMapping.proController[chan].enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED;
|
//if(gControllerMapping.proController[chan].enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED;
|
||||||
|
|
||||||
@ -809,6 +810,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setProControllerDataFromHI
|
|||||||
}
|
}
|
||||||
|
|
||||||
CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setControllerDataFromHID(VPADData * buffer){
|
CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::setControllerDataFromHID(VPADData * buffer){
|
||||||
|
if(buffer == NULL) return CONTROLLER_PATCHER_ERROR_NULL_POINTER;
|
||||||
//if(gControllerMapping.gamepad.enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED;
|
//if(gControllerMapping.gamepad.enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED;
|
||||||
|
|
||||||
s32 hidmask = 0;
|
s32 hidmask = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user