diff options
| author | 2023-05-27 22:10:54 -0400 | |
|---|---|---|
| committer | 2023-05-27 22:24:22 -0400 | |
| commit | fee91096ca71a7215a3d6e6b92cacc1227e23fd0 (patch) | |
| tree | 628984dc23e2602b3d9093f49a8e7326dac3d937 | |
| parent | Merge pull request #10414 from liamwhite/anv-push-descriptor (diff) | |
| download | yuzu-fee91096ca71a7215a3d6e6b92cacc1227e23fd0.tar.gz yuzu-fee91096ca71a7215a3d6e6b92cacc1227e23fd0.tar.xz yuzu-fee91096ca71a7215a3d6e6b92cacc1227e23fd0.zip | |
microprofile: Avoid crashing due to OOB stack pos
Diffstat (limited to '')
| -rw-r--r-- | externals/microprofile/microprofile.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index 639f3618c..8f75a25aa 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h | |||
| @@ -1697,7 +1697,13 @@ void MicroProfileFlip() | |||
| 1697 | { | 1697 | { |
| 1698 | int nTimer = MicroProfileLogTimerIndex(LE); | 1698 | int nTimer = MicroProfileLogTimerIndex(LE); |
| 1699 | uint8_t nGroup = pTimerToGroup[nTimer]; | 1699 | uint8_t nGroup = pTimerToGroup[nTimer]; |
| 1700 | MP_ASSERT(nStackPos < MICROPROFILE_STACK_MAX); | 1700 | |
| 1701 | // To avoid crashing due to OOB memory accesses/asserts | ||
| 1702 | // simply skip this iteration | ||
| 1703 | // MP_ASSERT(nStackPos < MICROPROFILE_STACK_MAX); | ||
| 1704 | if (nStackPos >= MICROPROFILE_STACK_MAX) { | ||
| 1705 | break; | ||
| 1706 | } | ||
| 1701 | MP_ASSERT(nGroup < MICROPROFILE_MAX_GROUPS); | 1707 | MP_ASSERT(nGroup < MICROPROFILE_MAX_GROUPS); |
| 1702 | pGroupStackPos[nGroup]++; | 1708 | pGroupStackPos[nGroup]++; |
| 1703 | pStack[nStackPos++] = k; | 1709 | pStack[nStackPos++] = k; |