瀏覽代碼

Merge pull request #141 from archshift/crash-hunt

hid.cpp: Fixed crash when updating pad data while null
bunnei 11 年之前
父節點
當前提交
a110b06fb6
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/core/hle/service/hid.cpp

+ 4 - 0
src/core/hle/service/hid.cpp

@@ -78,6 +78,10 @@ void PadButtonRelease(PadState pad_state) {
 void PadUpdateComplete() {
     PadData* pad_data = GetPadData();
 
+    if (pad_data == nullptr) {
+        return;
+    }
+
     // Update PadData struct
     pad_data->current_state.hex = next_state.hex;
     pad_data->index = next_index;