From 881acde51ca7904b37d4d6bf8956da01bdc05516 Mon Sep 17 00:00:00 2001 From: Jean-Philip Desjardins Date: Wed, 17 Jul 2024 14:33:13 -0400 Subject: [PATCH] Mark ReadValue as safebuffers to avoid security cookie overhead. --- Source/ee/Vif.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/ee/Vif.h b/Source/ee/Vif.h index e594123bff..bc53d800a8 100644 --- a/Source/ee/Vif.h +++ b/Source/ee/Vif.h @@ -15,6 +15,12 @@ #include #endif +#ifdef _MSC_VER +#define FRAMEWORK_SAFE_BUFFERS __declspec(safebuffers) +#else +#define FRAMEWORK_SAFE_BUFFERS +#endif + class CINTC; class CVif @@ -161,7 +167,7 @@ class CVif } template - inline void ReadValue(void* buffer) + inline FRAMEWORK_SAFE_BUFFERS void ReadValue(void* buffer) { //Hyper-specialized version of Read that allows the compiler to better //optimize the code. Will only work with reads of at most 16 bytes.