Skip to content

Commit

Permalink
Defensive check against backwards branching
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 4, 2024
1 parent 9ecda2a commit 83a98c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mods/vr/FFakeStereoRenderingHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6469,7 +6469,7 @@ bool VRRenderTargetManager_Base::allocate_render_target_texture(uintptr_t return
}
} else if (next_insn[0] == 0x84 && next_insn[1] == 0xC0) { // test al, al
if (auto ref = utility::find_string_reference_in_path((uintptr_t)next_insn, "IsInRenderingThread()", false); ref.has_value()) {
if (ref->addr - (uintptr_t)next_insn < 30) {
if (ref->addr > (uintptr_t)next_insn && ref->addr - (uintptr_t)next_insn < 30) {
SPDLOG_INFO("Found IsInRenderingThread() instead of the function we want, skipping this call!");
next_call_is_not_the_right_one = true;
}
Expand Down

0 comments on commit 83a98c4

Please sign in to comment.