From 5e905cf80d472c433875452a2baaa179ceb0fe71 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 9 Jun 2017 18:16:58 +0300 Subject: [PATCH 1/8] MAINT-7477 FIXED [viewer-neko] Viewer crashes when saving snapshot to disk and closing file picker window --- indra/newview/llsnapshotlivepreview.cpp | 7 ++++--- indra/newview/llviewerwindow.cpp | 5 ++++- indra/newview/llviewerwindow.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index c6f8c414fa..ee8b2d79c0 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -1080,12 +1080,13 @@ BOOL LLSnapshotLivePreview::saveLocal() return success; } -//Check if failed due to insuficient memory +//Check if failed due to insufficient memory BOOL LLSnapshotLivePreview::saveLocal(LLPointer mFormattedImage) { - BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage); + BOOL insufficient_memory; + BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage, FALSE, insufficient_memory); - if (!success) + if (insufficient_memory) { std::string lastSnapshotDir = LLViewerWindow::getLastSnapshotDir(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 45ea0f8e02..a2c5fa2630 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4354,8 +4354,10 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d } // Saves an image to the harddrive as "SnapshotX" where X >= 1. -BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker) +BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory) { + insufficient_memory = FALSE; + if (!image) { LL_WARNS() << "No image to save" << LL_ENDL; @@ -4407,6 +4409,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke #endif if (b_space.free < image->getDataSize()) { + insufficient_memory = TRUE; return FALSE; } // Look for an unused file name diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 5d7076178a..38178fa910 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -352,7 +352,7 @@ public: BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); BOOL isSnapshotLocSet() const { return ! sSnapshotDir.empty(); } void resetSnapshotLoc() const { sSnapshotDir.clear(); } - BOOL saveImageNumbered(LLImageFormatted *image, bool force_picker = false); + BOOL saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory); // Reset the directory where snapshots are saved. // Client will open directory picker on next snapshot save. From 5205be0c65bf8dee8b51c112083a4cc8a7cebc49 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Wed, 31 May 2017 19:28:46 +0300 Subject: [PATCH 2/8] STORM-2148 Crash on trying to save texture file(s) to computer from inventory --- doc/contributions.txt | 1 + indra/llimage/llimagepng.cpp | 4 ++-- indra/llimage/llpngwrapper.cpp | 8 +++++++- indra/llimage/llpngwrapper.h | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 1d591e2ec2..6e4cd76d77 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1304,6 +1304,7 @@ Sovereign Engineer MAINT-6218 MAINT-6913 STORM-2143 + STORM-2148 SpacedOut Frye VWR-34 VWR-45 diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp index a299602d79..a4823ed859 100644 --- a/indra/llimage/llimagepng.cpp +++ b/indra/llimage/llimagepng.cpp @@ -124,12 +124,12 @@ bool LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) // Temporary buffer to hold the encoded image. Note: the final image // size should be much smaller due to compression. - U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024; + U32 bufferSize = getWidth() * getHeight() * getComponents() + 8192; U8* tmpWriteBuffer = new U8[ bufferSize ]; // Delegate actual encoding work to wrapper LLPngWrapper pngWrapper; - if (! pngWrapper.writePng(raw_image, tmpWriteBuffer)) + if (!pngWrapper.writePng(raw_image, tmpWriteBuffer, bufferSize)) { setLastError(pngWrapper.getErrorMessage()); delete[] tmpWriteBuffer; diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index da289ea889..b2fa0ed315 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -112,6 +112,11 @@ void LLPngWrapper::readDataCallback(png_structp png_ptr, png_bytep dest, png_siz void LLPngWrapper::writeDataCallback(png_structp png_ptr, png_bytep src, png_size_t length) { PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr); + if (dataInfo->mOffset + length > dataInfo->mDataSize) + { + png_error(png_ptr, "Data write error. Requested data size exceeds available data size."); + return; + } U8 *dest = &dataInfo->mData[dataInfo->mOffset]; memcpy(dest, src, length); dataInfo->mOffset += static_cast(length); @@ -272,7 +277,7 @@ void LLPngWrapper::updateMetaData() // Method to write raw image into PNG at dest. The raw scanline begins // at the bottom of the image per SecondLife conventions. -BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest) +BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest, size_t destSize) { try { @@ -313,6 +318,7 @@ BOOL LLPngWrapper::writePng(const LLImageRaw* rawImage, U8* dest) PngDataInfo dataPtr; dataPtr.mData = dest; dataPtr.mOffset = 0; + dataPtr.mDataSize = destSize; png_set_write_fn(mWritePngPtr, &dataPtr, &writeDataCallback, &writeFlush); // Setup image params diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h index 27d7df3bef..8d42317b0f 100644 --- a/indra/llimage/llpngwrapper.h +++ b/indra/llimage/llpngwrapper.h @@ -45,7 +45,7 @@ public: BOOL isValidPng(U8* src); BOOL readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInfo *infop = NULL); - BOOL writePng(const LLImageRaw* rawImage, U8* dst); + BOOL writePng(const LLImageRaw* rawImage, U8* dst, size_t destSize); U32 getFinalSize(); const std::string& getErrorMessage(); From e4c262ec5e5636c47fe1df4f5f4bf2f1b1e06891 Mon Sep 17 00:00:00 2001 From: daianakproductengine Date: Tue, 6 Jun 2017 20:02:31 +0300 Subject: [PATCH 3/8] MAINT-321 Fixed User cannot lift an object using Ctrl button + Mouse if Spin option was turned on earlier --- indra/newview/lltoolgrab.cpp | 39 +++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 5623036b91..f3e661e71a 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -477,39 +477,53 @@ void LLToolGrabBase::handleHoverActive(S32 x, S32 y, MASK mask) return; } + //-------------------------------------------------- + // Determine target mode + //-------------------------------------------------- + bool vertical_dragging = false; + bool spin_grabbing = false; + if ((mask == MASK_VERTICAL) + || (gGrabBtnVertical && (mask != MASK_SPIN))) + { + vertical_dragging = TRUE; + } + else if ((mask == MASK_SPIN) + || (gGrabBtnSpin && (mask != MASK_VERTICAL))) + { + spin_grabbing = TRUE; + } + //-------------------------------------------------- // Toggle spinning //-------------------------------------------------- - if (mSpinGrabbing && !(mask == MASK_SPIN) && !gGrabBtnSpin) + if (mSpinGrabbing && !spin_grabbing) { - // user released ALT key, stop spinning + // user released or switched mask key(s), stop spinning stopSpin(); } - else if (!mSpinGrabbing && (mask == MASK_SPIN) ) + else if (!mSpinGrabbing && spin_grabbing) { - // user pressed ALT key, start spinning + // user pressed mask key(s), start spinning startSpin(); } + mSpinGrabbing = spin_grabbing; //-------------------------------------------------- // Toggle vertical dragging //-------------------------------------------------- - if (mVerticalDragging && !(mask == MASK_VERTICAL) && !gGrabBtnVertical) + if (mVerticalDragging && !vertical_dragging) { // ...switch to horizontal dragging - mVerticalDragging = FALSE; - mDragStartPointGlobal = gViewerWindow->clickPointInWorldGlobal(x, y, objectp); mDragStartFromCamera = mDragStartPointGlobal - gAgentCamera.getCameraPositionGlobal(); } - else if (!mVerticalDragging && (mask == MASK_VERTICAL) ) + else if (!mVerticalDragging && vertical_dragging) { // ...switch to vertical dragging - mVerticalDragging = TRUE; - mDragStartPointGlobal = gViewerWindow->clickPointInWorldGlobal(x, y, objectp); mDragStartFromCamera = mDragStartPointGlobal - gAgentCamera.getCameraPositionGlobal(); } + mVerticalDragging = vertical_dragging; const F32 RADIANS_PER_PIXEL_X = 0.01f; const F32 RADIANS_PER_PIXEL_Y = 0.01f; @@ -755,12 +769,13 @@ void LLToolGrabBase::handleHoverNonPhysical(S32 x, S32 y, MASK mask) //-------------------------------------------------- // Toggle vertical dragging //-------------------------------------------------- - if (mVerticalDragging && !(mask == MASK_VERTICAL) && !gGrabBtnVertical) + if (!(mask == MASK_VERTICAL) && !gGrabBtnVertical) { mVerticalDragging = FALSE; } - else if (!mVerticalDragging && (mask == MASK_VERTICAL) ) + else if ((gGrabBtnVertical && (mask != MASK_SPIN)) + || (mask == MASK_VERTICAL)) { mVerticalDragging = TRUE; } From 99b203d4e8e0ec530d0ee8b0627e5fa3cf0c59db Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 9 Jun 2017 14:06:04 +0100 Subject: [PATCH 4/8] MAINT-7482 - continue running with a warning on receipt of unknown message --- indra/llmessage/lltemplatemessagereader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 406afadd2f..4e0c53c37e 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -499,9 +499,10 @@ BOOL LLTemplateMessageReader::decodeTemplate( } else { - LL_WARNS() << "Message #" << std::hex << num << std::dec - << " received but not registered!" << LL_ENDL; - gMessageSystem->callExceptionFunc(MX_UNREGISTERED_MESSAGE); + // MAINT-7482 - make viewer more tolerant of unknown messages. + LL_WARNS_ONCE() << "Message #" << std::hex << num << std::dec + << " received but not registered!" << LL_ENDL; + //gMessageSystem->callExceptionFunc(MX_UNREGISTERED_MESSAGE); return(FALSE); } From d15e8577773b9afb92c232c757b89343c93d56bf Mon Sep 17 00:00:00 2001 From: eli Date: Fri, 9 Jun 2017 12:32:29 -0700 Subject: [PATCH 5/8] FIX MAINT-7456 Corrected translation errors in Russian and Spanish. --- indra/newview/installers/windows/lang_es.nsi | Bin 9884 -> 9872 bytes indra/newview/installers/windows/lang_ru.nsi | Bin 9190 -> 9188 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index 2310346e6ec5e0604067552e3ee0c745860acabe..1ecf254ffb484c59b8df0f2b50916a78045447e1 100644 GIT binary patch delta 32 mcmbQ^JHdCu7Wv7Ccw{zTlfT6ZVobg!FElw!)n~GSS`Gl}!VMGv delta 40 ocmbQ>JI8m!7I{`rh7tya$p?94H(!vy#fsogz926&`G)Ea03me_WdHyG diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index 2ac03d7bba42e0bf5ad3bcd8f3a8a9ac07929f2a..019c66123c811926eca0373fe1ac37b8d507793d 100644 GIT binary patch delta 53 zcmaFn{=|Jl8V{Q;ixZ0-%jP^D8$m{e$s1)wCvV_p+k8ScjTOP2?4vx3g_nVg0RY3m B4@3X} delta 90 zcmaFj{>*(t8V^SZLk2@8LovhV93C4%X-|d{1_cHO7E=~07CROjAZ^QH!r~01oi-no R&1A)=VDdp(@ySujZ2+5t69NDL From 34cfd3714b8c8f14effd55001191b0519861e2b0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 9 Jun 2017 22:02:42 +0300 Subject: [PATCH 6/8] MAINT-7478 Fixed "No callback" log spam --- indra/newview/llfloaterimnearbychat.cpp | 10 ++++++++++ indra/newview/llfloaterimsessiontab.cpp | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 7895a5ff48..b2568abb83 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -87,6 +87,10 @@ static LLChatTypeTrigger sChatTypeTriggers[] = { { "/shout" , CHAT_TYPE_SHOUT} }; +bool cb_do_nothing() +{ + return false; +} LLFloaterIMNearbyChat::LLFloaterIMNearbyChat(const LLSD& llsd) : LLFloaterIMSessionTab(LLSD(LLUUID::null)), @@ -97,6 +101,12 @@ LLFloaterIMNearbyChat::LLFloaterIMNearbyChat(const LLSD& llsd) mIsP2PChat = false; mIsNearbyChat = true; mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); + + // Required by LLFloaterIMSessionTab::mGearBtn + // But nearby floater has no 'per agent' menu items, + mEnableCallbackRegistrar.add("Avatar.EnableGearItem", boost::bind(&cb_do_nothing)); + mCommitCallbackRegistrar.add("Avatar.GearDoToSelected", boost::bind(&cb_do_nothing)); + mEnableCallbackRegistrar.add("Avatar.CheckGearItem", boost::bind(&cb_do_nothing)); } //static diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 2cd94c592a..e8dbd2598e 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -46,6 +46,10 @@ const F32 REFRESH_INTERVAL = 1.0f; +void cb_do_nothing() +{ +} + LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) : LLTransientDockableFloater(NULL, false, session_id), mIsP2PChat(false), @@ -82,6 +86,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2)); mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMSessionTab::enableContextMenuItem, this, _2)); mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMSessionTab::doToSelected, this, _2)); + mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&cb_do_nothing)); } LLFloaterIMSessionTab::~LLFloaterIMSessionTab() From 3d8dc8cd6dd4ea59ff226f91b114a3298f8f096f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Jun 2017 15:26:10 +0300 Subject: [PATCH 7/8] Fixed line endings for llpngwrapper.cpp --- indra/llimage/llpngwrapper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index b2fa0ed315..eb70b78a36 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -112,10 +112,10 @@ void LLPngWrapper::readDataCallback(png_structp png_ptr, png_bytep dest, png_siz void LLPngWrapper::writeDataCallback(png_structp png_ptr, png_bytep src, png_size_t length) { PngDataInfo *dataInfo = (PngDataInfo *) png_get_io_ptr(png_ptr); - if (dataInfo->mOffset + length > dataInfo->mDataSize) - { - png_error(png_ptr, "Data write error. Requested data size exceeds available data size."); - return; + if (dataInfo->mOffset + length > dataInfo->mDataSize) + { + png_error(png_ptr, "Data write error. Requested data size exceeds available data size."); + return; } U8 *dest = &dataInfo->mData[dataInfo->mOffset]; memcpy(dest, src, length); From 52a964376b6aabd1abadfb7329004c2e58b7b97a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Jun 2017 16:28:53 +0300 Subject: [PATCH 8/8] MAINT-7478 Build fix, boost function doesn't like 'reuse' of cb_do_nothing --- indra/newview/llfloaterimsessiontab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index e8dbd2598e..3aee08482b 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -46,7 +46,7 @@ const F32 REFRESH_INTERVAL = 1.0f; -void cb_do_nothing() +void cb_group_do_nothing() { } @@ -86,7 +86,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2)); mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMSessionTab::enableContextMenuItem, this, _2)); mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMSessionTab::doToSelected, this, _2)); - mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&cb_do_nothing)); + mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&cb_group_do_nothing)); } LLFloaterIMSessionTab::~LLFloaterIMSessionTab()