summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar comex2020-11-22 15:48:23 -0500
committerGravatar comex2020-11-24 12:59:41 -0500
commite8b2fd21d861997e558180d775b14afdc46f3bbd (patch)
tree3f4860a38b5935d305f4dd9d08924fc6e5705126 /src/core
parentMerge pull request #4451 from slashiee/extended-logging (diff)
downloadyuzu-e8b2fd21d861997e558180d775b14afdc46f3bbd.tar.gz
yuzu-e8b2fd21d861997e558180d775b14afdc46f3bbd.tar.xz
yuzu-e8b2fd21d861997e558180d775b14afdc46f3bbd.zip
nvdrv, video_core: Don't index out of bounds when given invalid syncpoint ID
- Use .at() instead of raw indexing when dealing with untrusted indices. - For the special case of WaitFence with syncpoint id UINT32_MAX, instead of crashing, log an error and ignore. This is what I get when running Super Mario Maker 2.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nvdrv/syncpoint_manager.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/service/nvdrv/syncpoint_manager.h b/src/core/hle/service/nvdrv/syncpoint_manager.h
index 4168b6c7e..d395c5d0b 100644
--- a/src/core/hle/service/nvdrv/syncpoint_manager.h
+++ b/src/core/hle/service/nvdrv/syncpoint_manager.h
@@ -37,7 +37,7 @@ public:
37 * @returns The lower bound for the specified syncpoint. 37 * @returns The lower bound for the specified syncpoint.
38 */ 38 */
39 u32 GetSyncpointMin(u32 syncpoint_id) const { 39 u32 GetSyncpointMin(u32 syncpoint_id) const {
40 return syncpoints[syncpoint_id].min.load(std::memory_order_relaxed); 40 return syncpoints.at(syncpoint_id).min.load(std::memory_order_relaxed);
41 } 41 }
42 42
43 /** 43 /**
@@ -46,7 +46,7 @@ public:
46 * @returns The upper bound for the specified syncpoint. 46 * @returns The upper bound for the specified syncpoint.
47 */ 47 */
48 u32 GetSyncpointMax(u32 syncpoint_id) const { 48 u32 GetSyncpointMax(u32 syncpoint_id) const {
49 return syncpoints[syncpoint_id].max.load(std::memory_order_relaxed); 49 return syncpoints.at(syncpoint_id).max.load(std::memory_order_relaxed);
50 } 50 }
51 51
52 /** 52 /**