if plugin filename ends with _32, ignore it on 64 bit OS (and vice versa)

This commit is contained in:
UnknownShadow200 2020-08-02 12:44:28 +10:00
parent dcf1b9a49e
commit 4072b62439
2 changed files with 6 additions and 4 deletions

View File

@ -512,8 +512,7 @@ void Inflate_Process(struct InflateState* state) {
nlen = Inflate_ReadBits(state, 16);
if (len != (nlen ^ 0xFFFFUL)) {
Inflate_Fail(state, INF_ERR_BLOCKTYPE);
return;
Inflate_Fail(state, INF_ERR_BLOCKTYPE); return;
}
state->Index = len; /* Reuse for 'uncompressed length' */
state->State = INFLATE_STATE_UNCOMPRESSED_DATA;
@ -625,8 +624,7 @@ void Inflate_Process(struct InflateState* state) {
count = state->NumLits + state->NumDists;
if (state->Index + repeatCount > count) {
Inflate_Fail(state, INF_ERR_REPEAT_END);
return;
Inflate_Fail(state, INF_ERR_REPEAT_END); return;
}
Mem_Set(&state->Buffer[state->Index], repeatValue, repeatCount);

View File

@ -342,6 +342,10 @@ static void LoadPlugin(const String* path, void* obj) {
/* ignore accepted.txt, deskop.ini, .pdb files, etc */
if (!String_CaselessEnds(path, &DynamicLib_Ext)) return;
/* don't try to load 32 bit plugins on 64 bit OS or vice versa */
if (sizeof(void*) == 4 && String_ContainsConst(path, "_64.")) return;
if (sizeof(void*) == 8 && String_ContainsConst(path, "_32.")) return;
lib = DynamicLib_Load2(path);
if (!lib) { Logger_DynamicLibWarn("loading", path); return; }