From 84d80855c0e63bb76bd2cedf2c38acf989b05e2e Mon Sep 17 00:00:00 2001 From: oltolm Date: Mon, 16 Sep 2024 00:20:20 +0200 Subject: [PATCH] microvu: fix ASAN container-overflow in mVUsetupRange --- pcsx2/x86/microVU_Compile.inl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index ae395ec9ca00f..8084d581d4367 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -81,11 +81,9 @@ void mVUsetupRange(microVU& mVU, s32 pc, bool isStartPC) if (mVUrange.start <= cur_pc) { mVUrange.end = cur_pc; - s32& rStart = mVUrange.start; - s32& rEnd = mVUrange.end; - std::deque::iterator it(ranges->begin()); - it++; - for (;it != ranges->end();) + s32 rStart = mVUrange.start; + s32 rEnd = mVUrange.end; + for (auto it = ranges->begin() + 1; it != ranges->end();) { if (((it->start >= rStart) && (it->start <= rEnd)) || ((it->end >= rStart) && (it->end <= rEnd))) // Starts after this prog but starts before the end of current prog {