diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 63d06e338..b39ae0c04 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -363,8 +363,12 @@ S32 LLImageJ2C::calcHeaderSizeJ2C() return FIRST_PACKET_SIZE; // Hack. just needs to be >= actual header size... } -static S32 cald_data_size_help(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) +//static +S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) { + // Note: this only provides an *estimate* of the size in bytes of an image level + // *TODO: find a way to read the true size (when available) and convey the fact + // that the result is an estimate in the other cases if (rate <= 0.f) rate = .125f; while (discard_level > 0) { @@ -375,22 +379,7 @@ static S32 cald_data_size_help(S32 w, S32 h, S32 comp, S32 discard_level, F32 ra discard_level--; } S32 bytes = (S32)((F32)(w*h*comp)*rate); - return bytes; -} - - -//static -S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) -{ - static const LLCachedControl exponent("SianaJ2CSizeExponent", 1.0f); - static const LLCachedControl offset("SianaJ2CSizeOffset", 0); - S32 size = cald_data_size_help(w, h, comp, discard_level, rate); - S32 size_d0 = cald_data_size_help(w, h, comp, 0, rate); - - llassert_always(size_d0); - S32 bytes = size_d0*pow((double)size/size_d0, (double)exponent) + offset; - bytes = llmax (0, bytes - 600); - bytes = ((bytes + (1000 - 1))/1000)*1000 + 600; + bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; } diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 90ca3fea7..04662cf24 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -124,9 +124,14 @@ BOOL PreventSetUnhandledExceptionFilter() newJump[ 0 ] = 0xE9; // JMP absolute memcpy( &newJump[ 1 ], &dwRelativeAddr, sizeof( pNewFunc ) ); - SIZE_T bytesWritten; - BOOL bRet = WriteProcessMemory( GetCurrentProcess(), pOrgEntry, newJump, sizeof( pNewFunc ) + 1, &bytesWritten ); - return bRet; + //SIZE_T bytesWritten; + //BOOL bRet = WriteProcessMemory( GetCurrentProcess(), pOrgEntry, newJump, sizeof( pNewFunc ) + 1, &bytesWritten ); + DWORD oldProtect; + BOOL bRet = VirtualProtect(pOrgEntry, sizeof(pNewFunc) + 1, PAGE_READWRITE, &oldProtect); + if (!bRet) return FALSE; + memcpy(pOrgEntry, newJump, sizeof(pNewFunc) + 1); + VirtualProtect(pOrgEntry, sizeof(pNewFunc) + 1, oldProtect, &oldProtect); + return TRUE; #else return FALSE; #endif diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 64fd98527..5a877e72a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -278,29 +278,6 @@ - SianaJ2CSizeExponent - - Comment - Exponent of size estimator. Should be between 0.0 and 1.0 - Persist - 1 - Type - F32 - Value - 1.0 - - SianaJ2CSizeOffset - - Comment - Number of bytes to add to size estimator. - Persist - 1 - Type - S32 - Value - 0 - - SianaLegacyJ2CSize Comment diff --git a/indra/newview/llprefsvoice.cpp b/indra/newview/llprefsvoice.cpp index e45a9c2c2..b009dff6d 100644 --- a/indra/newview/llprefsvoice.cpp +++ b/indra/newview/llprefsvoice.cpp @@ -114,7 +114,7 @@ BOOL LLPrefsVoice::postBuild() childSetCommitCallback("enable_voice_check", onCommitEnableVoiceChat, this); childSetAction("set_voice_hotkey_button", onClickSetKey, this); childSetAction("set_voice_middlemouse_button", onClickSetMiddleMouse, this); - childSetAction("device_settings_btn", onClickVoiceDeviceSettings, NULL); + childSetAction("device_settings_btn", onClickVoiceDeviceSettings, this); BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); childSetVisible("voice_unavailable", voice_disabled); diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 5c7ee642d..9b6ae853f 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -690,31 +690,6 @@ LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter( return gFilterFunc; } -BOOL PreventSetUnhandledExceptionFilter() -{ - HMODULE hKernel32 = LoadLibrary(_T("kernel32.dll")); - if (hKernel32 == NULL) - return FALSE; - - void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter"); - if(pOrgEntry == NULL) - return FALSE; - - unsigned char newJump[ 100 ]; - DWORD dwOrgEntryAddr = (DWORD)pOrgEntry; - dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far - void *pNewFunc = &MyDummySetUnhandledExceptionFilter; - DWORD dwNewEntryAddr = (DWORD) pNewFunc; - DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr; - - newJump[ 0 ] = 0xE9; // JMP absolute - memcpy(&newJump[ 1 ], &dwRelativeAddr, sizeof(pNewFunc)); - SIZE_T bytesWritten; - BOOL bRet = WriteProcessMemory(GetCurrentProcess(), - pOrgEntry, newJump, sizeof(pNewFunc) + 1, &bytesWritten); - return bRet; -} - // static void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) { @@ -765,9 +740,6 @@ void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; prev_filter = SetUnhandledExceptionFilter(filter_func); - // *REMOVE:Mani - //PreventSetUnhandledExceptionFilter(); - if(prev_filter != gFilterFunc) { LL_WARNS("AppInit")