Adding more checks for NULL-Pointer

This commit is contained in:
Maschell 2017-04-11 14:38:53 +02:00
parent 41012b4543
commit bb6964cd6f

View File

@ -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){
if(data == NULL) return CONTROLLER_PATCHER_ERROR_NULL_POINTER;
if(chan < 0 || chan > 3) return CONTROLLER_PATCHER_ERROR_INVALID_CHAN;
//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){
if(buffer == NULL) return CONTROLLER_PATCHER_ERROR_NULL_POINTER;
//if(gControllerMapping.gamepad.enabled == 0) return CONTROLLER_PATCHER_ERROR_MAPPING_DISABLED;
s32 hidmask = 0;