diff --git a/H2Codez/Common/H2EKCommon.cpp b/H2Codez/Common/H2EKCommon.cpp index d88f805..4ebd06e 100644 --- a/H2Codez/Common/H2EKCommon.cpp +++ b/H2Codez/Common/H2EKCommon.cpp @@ -377,6 +377,11 @@ static void set_tag_data_max_size(size_t limit) WriteValue(offset + 1, limit); } +static bool __cdecl check_bitmap_dimension(int format, int type, __int16 dimension) +{ + return dimension > 0 && dimension <= 8192; +} + void H2CommonPatches::Init() { DetourTransactionBegin(); @@ -404,6 +409,8 @@ void H2CommonPatches::Init() DetourAttach(&(PVOID&)tags__fix_corrupt_fields_org, tags__fix_corrupt_fields___hook); } + WriteJmp(SwitchByMode(0x720FF0, 0x6FFCE0, 0x65D030), check_bitmap_dimension); + fix_documents_path_string_type(); haloscript_init();