From 459bc20a7766a9645f5b54fa4ea50f2032bedcc3 Mon Sep 17 00:00:00 2001 From: Lord_Cambion Date: Tue, 7 Apr 2026 00:45:52 +0200 Subject: [PATCH] dlcfix --- Minecraft.Client/Common/DLC/DLCAudioFile.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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;