diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp index 85ea3095..480569b1 100644 --- a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp +++ b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp @@ -170,6 +170,14 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) for(unsigned int i=0;i(pFile->dwType); + + //Bounds Checking + if (type < 0 || type >= e_AudioType_Max) + { + app.DebugPrintf("Error parser: EAudioType (%d) out of bounds!\n", type); + + continue; + } // Params unsigned int uiParameterCount=*(unsigned int *)pbTemp; pbTemp+=sizeof(int); @@ -182,7 +190,8 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) if(it != parameterMapping.end() ) { - addParameter(type,static_cast(pParams->dwType),(WCHAR *)pParams->wchData); + //addParameter(type,static_cast(pParams->dwType),(WCHAR *)pParams->wchData); + addParameter(type, it->second, (WCHAR *)pParams->wchData); } pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount); pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp; diff --git a/README.md b/README.md index bd6f394e..9d35a5e0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Huge thanks to the following projects: - [Legacy Minigame Restoration Project](https://discord.gg/bg2kmbzFzv) - for their immense help with our project's deep decompilation work - [Patoke/LCERenewed](https://github.com/Patoke/LCERenewed) - for some of the patches that required deep decompilation -- [smartcmd/MinecraftConsoles](https://github.com/smartcmd/MinecraftConsoles) - for creating such a great repo # Build & Run