diff options
author | ameerj <[email protected]> | 2023-05-27 22:10:54 -0400 |
---|---|---|
committer | ameerj <[email protected]> | 2023-05-27 22:24:22 -0400 |
commit | fee91096ca71a7215a3d6e6b92cacc1227e23fd0 (patch) | |
tree | 628984dc23e2602b3d9093f49a8e7326dac3d937 /externals/microprofile/microprofile.h | |
parent | d6db422098ad12d95396a23f60f005893eb9b720 (diff) | |
download | yuzu-android-fee91096ca71a7215a3d6e6b92cacc1227e23fd0.tar.gz yuzu-android-fee91096ca71a7215a3d6e6b92cacc1227e23fd0.zip |
microprofile: Avoid crashing due to OOB stack pos
Diffstat (limited to 'externals/microprofile/microprofile.h')
-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() { int nTimer = MicroProfileLogTimerIndex(LE); uint8_t nGroup = pTimerToGroup[nTimer]; - MP_ASSERT(nStackPos < MICROPROFILE_STACK_MAX); + + // To avoid crashing due to OOB memory accesses/asserts + // simply skip this iteration + // MP_ASSERT(nStackPos < MICROPROFILE_STACK_MAX); + if (nStackPos >= MICROPROFILE_STACK_MAX) { + break; + } MP_ASSERT(nGroup < MICROPROFILE_MAX_GROUPS); pGroupStackPos[nGroup]++; pStack[nStackPos++] = k; |