From 4cad6333ab447713e96fb14a278e529f5bc4f2a1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 11:53:17 -0800 Subject: CID-417 Checker: UNINIT_CTOR Function: LLFoundData::LLFoundData() File: /indra/newview/llappearancemgr.cpp --- indra/newview/llappearancemgr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1dec8c7bd8..8f4ce4498e 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -292,11 +292,11 @@ private: struct LLFoundData { - LLFoundData() {} + LLFoundData() : mAssetType(LLAssetType::AT_NONE), mWearable(NULL) {} LLFoundData(const LLUUID& item_id, - const LLUUID& asset_id, - const std::string& name, - LLAssetType::EType asset_type) : + const LLUUID& asset_id, + const std::string& name, + LLAssetType::EType asset_type) : mItemID(item_id), mAssetID(asset_id), mName(name), -- cgit v1.2.3 From 3acf25d5fc7d3efcc2e13096ff781897ebf31346 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 11:55:34 -0800 Subject: CID-416 Checker: NULL_RETURNS Function: LLTabContainer::onTabBtn(const LLSD &, LLPanel *) File: /indra/llui/lltabcontainer.cpp --- indra/llui/lltabcontainer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index dcb3542e18..6be76605fd 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1590,7 +1590,10 @@ void LLTabContainer::onTabBtn( const LLSD& data, LLPanel* panel ) LLTabTuple* tuple = getTabByPanel(panel); selectTabPanel( panel ); - tuple->mTabPanel->setFocus(TRUE); + if (tuple) + { + tuple->mTabPanel->setFocus(TRUE); + } } void LLTabContainer::onNextBtn( const LLSD& data ) -- cgit v1.2.3 From f714e527c57741a6e60fe4bf5fa242b5d8e3d861 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 11:57:55 -0800 Subject: CID-415 Checker: DEADCODE Function: LLToolPie::handleTooltipObject(LLViewerObject *, std::basic_string, std::allocator>, std::basic_string, std::allocator>) File: /indra/newview/lltoolpie.cpp --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index c79a66892d..39e71974fd 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -922,7 +922,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; if (mep) { - viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; + viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); LLPluginClassMedia* media_plugin = NULL; if (media_impl.notNull() && (media_impl->hasMedia())) -- cgit v1.2.3 From 73665e5ad68ebbe2a6058128f92d251da4cd9d3b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 11:59:55 -0800 Subject: CID-1 Checker: BAD_COMPARE Function: checkExceptionHandler() File: /indra/llplugin/slplugin/slplugin.cpp (not a bug, but rearranged a little) --- indra/llplugin/slplugin/slplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 23dc532ba5..77240ce546 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -156,7 +156,7 @@ bool checkExceptionHandler() if (prev_filter == NULL) { ok = FALSE; - if (myWin32ExceptionHandler == NULL) + if (NULL == myWin32ExceptionHandler) { LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; } -- cgit v1.2.3 From a0bc58aac498dff7f06070bf3be025b5e396f84f Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 12:07:05 -0800 Subject: CID-26 Checker: CTOR_DTOR_LEAK Function: LLViewerWindow::LLViewerWindow(const std::basic_string, std::allocator>&, const std::basic_string, std::allocator>&, int, int, int, int, int, int) File: /indra/newview/llviewerwindow.cpp --- indra/newview/llviewerwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c1817496b1..424b84a756 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1659,6 +1659,9 @@ LLViewerWindow::~LLViewerWindow() { llinfos << "Destroying Window" << llendl; destroyWindow(); + + delete mDebugText; + mDebugText = NULL; } -- cgit v1.2.3 From 2f062b9e5c761bce6d4d29e1a40283e37dfdfd53 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:02:19 -0800 Subject: CID-105 Checker: INVALIDATE_ITERATOR Function: LLLocationHistory::addItem(const LLLocationHistoryItem &) File: /indra/newview/lllocationhistory.cpp --- indra/newview/lllocationhistory.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index ae1b8f8540..f494f7d7c1 100644 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -50,18 +50,19 @@ void LLLocationHistory::addItem(const LLLocationHistoryItem& item) { // check if this item doesn't duplicate any existing one location_list_t::iterator item_iter = std::find(mItems.begin(), mItems.end(),item); - if(item_iter != mItems.end()){ + if(item_iter != mItems.end()) // if it already exists, erase the old one + { mItems.erase(item_iter); } mItems.push_back(item); - // If the vector size exceeds the maximum, purge the oldest items. - if ((S32)mItems.size() > max_items) { - for(location_list_t::iterator i = mItems.begin(); i != mItems.end()-max_items; ++i) { - mItems.erase(i); - } + // If the vector size exceeds the maximum, purge the oldest items (at the start of the mItems vector). + if ((S32)mItems.size() > max_items) + { + mItems.erase(mItems.begin(), mItems.end()-max_items); } + llassert(mItems.size() <= max_items); } /* -- cgit v1.2.3 From c48f2d7873568c26d835d6ce1d80c3c3533854a6 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:04:22 -0800 Subject: CID-104 Checker: INVALIDATE_ITERATOR Function: LLViewerWindowListener::saveSnapshot(const LLSD &) const File: /indra/newview/llviewerwindowlistener.cpp not a bug. --- indra/newview/llviewerwindowlistener.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp index de57788271..fae98cf49a 100644 --- a/indra/newview/llviewerwindowlistener.cpp +++ b/indra/newview/llviewerwindowlistener.cpp @@ -77,6 +77,7 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const { LL_ERRS("LLViewerWindowListener") << "LLViewerWindowListener::saveSnapshot(): " << "unrecognized type " << event["type"] << LL_ENDL; + return; } type = found->second; } -- cgit v1.2.3 From 706fd4d0735e446ea6c9eab7387990375af53c48 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:06:26 -0800 Subject: CID-103 Checker: INVALIDATE_ITERATOR Function: LLMenuGL::scrollItemsDown() File: /indra/llui/llmenugl.cpp --- indra/llui/llmenugl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index c172a2b714..171269e30d 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1883,7 +1883,8 @@ void LLMenuGL::scrollItemsDown() } } - if ((*next_item_iter)->getVisible()) + if (next_item_iter != mItems.end() && + (*next_item_iter)->getVisible()) { mFirstVisibleItem = *next_item_iter; } -- cgit v1.2.3 From 668e72e2901ebf377661572fd30954d41e0e7c15 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:08:15 -0800 Subject: CID-103 Checker: INVALIDATE_ITERATOR Function: LLMenuGL::scrollItemsDown() File: /indra/llui/llmenugl.cpp --- indra/llui/llmenugl.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 171269e30d..ead28426cd 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1875,18 +1875,21 @@ void LLMenuGL::scrollItemsDown() item_list_t::iterator next_item_iter; - for (next_item_iter = ++cur_item_iter; next_item_iter != mItems.end(); next_item_iter++) + if (cur_item_iterator != mItems.end()) { - if( (*next_item_iter)->getVisible()) + for (next_item_iter = ++cur_item_iter; next_item_iter != mItems.end(); next_item_iter++) { - break; + if( (*next_item_iter)->getVisible()) + { + break; + } + } + + if (next_item_iter != mItems.end() && + (*next_item_iter)->getVisible()) + { + mFirstVisibleItem = *next_item_iter; } - } - - if (next_item_iter != mItems.end() && - (*next_item_iter)->getVisible()) - { - mFirstVisibleItem = *next_item_iter; } mNeedsArrange = TRUE; -- cgit v1.2.3 From 05260ba76d020072e5b08bd07fa77408aee4442e Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:09:25 -0800 Subject: follow-up fix --- indra/llui/llmenugl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index ead28426cd..ceb1e9820e 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1875,7 +1875,7 @@ void LLMenuGL::scrollItemsDown() item_list_t::iterator next_item_iter; - if (cur_item_iterator != mItems.end()) + if (cur_item_iter != mItems.end()) { for (next_item_iter = ++cur_item_iter; next_item_iter != mItems.end(); next_item_iter++) { -- cgit v1.2.3 From 599e96f32815733eb2bbd9aef5984d410644a10a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:11:02 -0800 Subject: CID-102 Checker: INVALIDATE_ITERATOR Function: LLNotifications::getChannel(const std::basic_string, std::allocator>&) File: /indra/llui/llnotifications.cpp not a bug. --- indra/llui/llnotifications.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 86989012ee..a67094b8ce 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1058,6 +1058,7 @@ LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelN if(p == mChannels.end()) { llerrs << "Did not find channel named " << channelName << llendl; + return LLNotificationChannelPtr(); } return p->second; } -- cgit v1.2.3 From 3aed137a33712f9000333aa814f76183158183cb Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:15:13 -0800 Subject: CID-101 Checker: INVALIDATE_ITERATOR Function: LLTextureCache::writeComplete(unsigned int, bool) File: /indra/newview/lltexturecache.cpp not really a bug, but rearranged a little. --- indra/newview/lltexturecache.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 051c189013..7dfd0c83fa 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1617,20 +1617,19 @@ bool LLTextureCache::writeComplete(handle_t handle, bool abort) { lockWorkers(); handle_map_t::iterator iter = mWriters.find(handle); - llassert_always(iter != mWriters.end()); - LLTextureCacheWorker* worker = iter->second; - if (worker->complete() || abort) + if (llverify(iter != mWriters.end())) { - mWriters.erase(handle); - unlockWorkers(); - worker->scheduleDelete(); - return true; - } - else - { - unlockWorkers(); - return false; + LLTextureCacheWorker* worker = iter->second; + if (worker->complete() || abort) + { + mWriters.erase(handle); + unlockWorkers(); + worker->scheduleDelete(); + return true; + } } + unlockWorkers(); + return false; } void LLTextureCache::prioritizeWrite(handle_t handle) -- cgit v1.2.3 From c69ee5ced1ba3b8e96a08e2f0344eedd971ef3c1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:18:49 -0800 Subject: CID-100 Checker: INVALIDATE_ITERATOR Function: buildBlock(unsigned char *, int, const LLMessageBlock *, LLMsgData *) File: /indra/llmessage/lltemplatemessagebuilder.cpp --- indra/llmessage/lltemplatemessagebuilder.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp index 6400310c46..55379fc6fd 100644 --- a/indra/llmessage/lltemplatemessagebuilder.cpp +++ b/indra/llmessage/lltemplatemessagebuilder.cpp @@ -737,10 +737,14 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat } --block_count; - ++block_iter; + if (block_iter != message_data->mMemberBlocks.end()) { - mbci = block_iter->second; + ++block_iter; + if (block_iter != message_data->mMemberBlocks.end()) + { + mbci = block_iter->second; + } } } -- cgit v1.2.3 From eeb30616f601a8e75403d7eb8ffed272a5915a17 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:26:05 -0800 Subject: CID-99 Checker: INVALIDATE_ITERATOR Function: LLAllocatorHeapProfile::parse(const std::basic_string, std::allocator>&) File: /indra/llcommon/llallocator_heap_profile.cpp not a bug, but make it clearer to coverity. --- indra/llcommon/llallocator_heap_profile.cpp | 31 ++++++++++++++++------------- indra/newview/lltexturecache.cpp | 3 ++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index 0a807702d0..d01b33c8c4 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -113,20 +113,23 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) ++j; while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens - llassert_always(j != line_elems.end()); - ++j; // skip the '@' - - mLines.push_back(line(live_count, live_size, tot_count, tot_size)); - line & current_line = mLines.back(); - - for(; j != line_elems.end(); ++j) - { - if(!j->empty()) { - U32 marker = boost::lexical_cast(*j); - current_line.mTrace.push_back(marker); - } - } - } + llassert(j != line_elems.end()); + if (j != line_elems.end()) + { + ++j; // skip the '@' + + mLines.push_back(line(live_count, live_size, tot_count, tot_size)); + line & current_line = mLines.back(); + + for(; j != line_elems.end(); ++j) + { + if(!j->empty()) + { + U32 marker = boost::lexical_cast(*j); + current_line.mTrace.push_back(marker); + } + } + } // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 7dfd0c83fa..a7f26f1df1 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1617,7 +1617,8 @@ bool LLTextureCache::writeComplete(handle_t handle, bool abort) { lockWorkers(); handle_map_t::iterator iter = mWriters.find(handle); - if (llverify(iter != mWriters.end())) + llassert(iter != mWriters.end()); + if (iter != mWriters.end()) { LLTextureCacheWorker* worker = iter->second; if (worker->complete() || abort) -- cgit v1.2.3 From 3616ed1e996f276b3ad195e1f2c9b2f87a5b1455 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:28:13 -0800 Subject: sigh, follow-up fix. --- indra/llcommon/llallocator_heap_profile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index d01b33c8c4..e50d59fd4b 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -130,7 +130,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) } } } - + } // *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it } -- cgit v1.2.3 From bada10e2f2fcd15eff4aeec82288c4c64ad258ef Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:32:21 -0800 Subject: CID-114 Checker: MISSING_BREAK Function: renderBoundingBox(LLDrawable *, int) File: /indra/newview/llspatialpartition.cpp --- indra/newview/llspatialpartition.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 514d8facb4..465221c494 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2607,6 +2607,7 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) break; case LL_PCODE_LEGACY_TREE: gGL.color4f(0,0.5f,0,1); + break; default: gGL.color4f(1,0,1,1); break; -- cgit v1.2.3 From 5aedcb39362b64c22fc5e70135b44d1388cbd5a2 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:34:49 -0800 Subject: CID-112 Checker: MISSING_BREAK Function: LLViewerObject::processUpdateMessage(LLMessageSystem *, void **, unsigned int, e_object_update_type, LLDataPacker *) File: /indra/newview/llviewerobject.cpp not a bug. commented. --- indra/newview/llviewerobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3c79045cc5..037393a8f9 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1172,6 +1172,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, htonmemcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); + // fall through case 60: // this is a terse 32 update // pos @@ -1211,6 +1212,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, htonmemcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); + // fall through case 32: // this is a terse 16 update this_update_precision = 16; -- cgit v1.2.3 From c84aa46ac8544704861a1fe12ef217d38e3f6276 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:36:27 -0800 Subject: CID-111 Checker: MISSING_BREAK Function: LLViewerObject::processUpdateMessage(LLMessageSystem *, void **, unsigned int, e_object_update_type, LLDataPacker *) File: /indra/newview/llviewerobject.cpp not a bug. commented. --- indra/newview/llviewerobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 037393a8f9..886f1d9ef5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -861,6 +861,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, htonmemcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); + // fall through case 60: this_update_precision = 32; // this is a terse update @@ -900,6 +901,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, htonmemcpy(collision_plane.mV, &data[count], MVT_LLVector4, sizeof(LLVector4)); ((LLVOAvatar*)this)->setFootPlane(collision_plane); count += sizeof(LLVector4); + // fall through case 32: this_update_precision = 16; test_pos_parent.quantize16(-0.5f*size, 1.5f*size, MIN_HEIGHT, MAX_HEIGHT); -- cgit v1.2.3 From e67d2bb5556adbccedc9e75443f7ac873c8d8259 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:37:45 -0800 Subject: CID-110 Checker: MISSING_BREAK Function: LLTransferSourceChannel::updateTransfers() File: /indra/llmessage/lltransfermanager.cpp not a bug, commented. --- indra/llmessage/lltransfermanager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index d67911e8e2..0a71ad95f2 100644 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -855,6 +855,7 @@ void LLTransferSourceChannel::updateTransfers() break; case LLTS_ERROR: llwarns << "Error in transfer dataCallback!" << llendl; + // fall through case LLTS_DONE: // We need to clean up this transfer source. //llinfos << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << llendl; -- cgit v1.2.3 From 4421a51cfeb43b3be6de520acb9f94052fc7e2df Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:39:59 -0800 Subject: CID-109 Checker: MISSING_BREAK Function: operator <<(std::basic_ostream>&, const LLNameValue &) File: /indra/llmessage/llnamevalue.cpp --- indra/llmessage/llnamevalue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp index 01e922eba2..43429b0ab3 100644 --- a/indra/llmessage/llnamevalue.cpp +++ b/indra/llmessage/llnamevalue.cpp @@ -963,6 +963,7 @@ std::ostream& operator<<(std::ostream& s, const LLNameValue &a) U64_to_str(*a.mNameValueReference.u64, u64_string, sizeof(u64_string)); s << u64_string; } + break; case NVT_VEC3: s << *(a.mNameValueReference.vec3); break; -- cgit v1.2.3 From 481bf863c2194400fec15c3ebaac4a0f4d69ed6d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:49:44 -0800 Subject: CID-129 Checker: NO_EFFECT Function: LLTexLayerTemplate::getLayer(unsigned int) File: /indra/newview/lltexlayer.cpp --- indra/newview/lltexlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 84c8b9d5f0..b8419e088a 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -1860,7 +1860,7 @@ U32 LLTexLayerTemplate::updateWearableCache() } LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) { - if (mWearableCache.size() <= i || i < 0) + if (mWearableCache.size() <= i) { return NULL; } -- cgit v1.2.3 From e998513aa5e0aad186a16518e1d693fd2b3cf2b7 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:53:40 -0800 Subject: CID-128 Checker: NO_EFFECT Function: LLSpatialGroup::~LLSpatialGroup() File: /indra/newview/llspatialpartition.cpp --- indra/newview/llspatialpartition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 465221c494..2a57d48f16 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -294,7 +294,7 @@ LLSpatialGroup::~LLSpatialGroup() sNodeCount--; - if (gGLManager.mHasOcclusionQuery && mOcclusionQuery) + if (gGLManager.mHasOcclusionQuery && mOcclusionQuery[LLViewerCamera::sCurCameraID]) { sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]); } -- cgit v1.2.3 From f7f4dae3d82d8ea97f60170c3468fa622639a6ad Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:56:53 -0800 Subject: CID-127 Checker: NO_EFFECT Function: LLOctreeNode::updateMinMax() File: /indra/llmath/lloctree.h --- indra/llmath/lloctree.h | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index ba8776690a..2f34fb1bb0 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -183,7 +183,6 @@ public: { mMax.mdV[i] = mCenter.mdV[i] + mSize.mdV[i]; mMin.mdV[i] = mCenter.mdV[i] - mSize.mdV[i]; - mCenter.mdV[i] = mCenter.mdV[i]; } } -- cgit v1.2.3 From 132cb6dbfe256cbf1a7b7558b091a63f99a364be Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:58:04 -0800 Subject: CID-126 Checker: NO_EFFECT Function: LLFontBitmapCache::getImageGL(unsigned int) const File: /indra/llrender/llfontbitmapcache.cpp --- indra/llrender/llfontbitmapcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index f01878642a..cc9a012f98 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -72,7 +72,7 @@ LLImageRaw *LLFontBitmapCache::getImageRaw(U32 bitmap_num) const LLImageGL *LLFontBitmapCache::getImageGL(U32 bitmap_num) const { - if ((bitmap_num < 0) || (bitmap_num >= mImageGLVec.size())) + if (bitmap_num >= mImageGLVec.size()) return NULL; return mImageGLVec[bitmap_num]; -- cgit v1.2.3 From ccacd7d7acb1a24b754008cd35e9552fed93a1d1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 13:58:48 -0800 Subject: CID-125 Checker: NO_EFFECT Function: LLFontBitmapCache::getImageRaw(unsigned int) const File: /indra/llrender/llfontbitmapcache.cpp --- indra/llrender/llfontbitmapcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index cc9a012f98..fa231c9e6a 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -64,7 +64,7 @@ void LLFontBitmapCache::init(S32 num_components, LLImageRaw *LLFontBitmapCache::getImageRaw(U32 bitmap_num) const { - if ((bitmap_num < 0) || (bitmap_num >= mImageRawVec.size())) + if (bitmap_num >= mImageRawVec.size()) return NULL; return mImageRawVec[bitmap_num]; -- cgit v1.2.3 From d3f361752e5988800228cff11fcc50289b2f88c7 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Wed, 27 Jan 2010 14:00:02 -0800 Subject: Plumb getting and setting the system audio mute through appviewer Next step is to actually implement the OS-specific calls to do so. Until then, behavior is the same; the status bar will mute/unmute the "master" audio for the viewer *only* --- indra/newview/llappviewer.cpp | 14 +++++++++++++- indra/newview/llappviewer.h | 4 ++++ indra/newview/llappviewermacosx.cpp | 14 ++++++++++++++ indra/newview/llappviewermacosx.h | 3 +++ indra/newview/llstatusbar.cpp | 6 +++--- 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0e248ff88b..9aa15789ed 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2685,7 +2685,7 @@ void LLAppViewer::handleViewerCrash() gMessageSystem->stopLogging(); } - LLWorld::getInstance()->getInfo(gDebugInfo); + if (LLWorld::instanceExists()) LLWorld::getInstance()->getInfo(gDebugInfo); // Close the debug file pApp->writeDebugInfo(); @@ -4405,3 +4405,15 @@ void LLAppViewer::launchUpdater() // LLAppViewer::instance()->forceQuit(); } + +//virtual +void LLAppViewer::setMasterSystemAudioMute(bool mute) +{ + gSavedSettings.setBOOL("MuteAudio", mute); +} + +//virtual +bool LLAppViewer::getMasterSystemAudioMute() +{ + return gSavedSettings.getBOOL("MuteAudio"); +} diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 40e74061b5..a011c5ebfd 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -168,6 +168,10 @@ public: void purgeCache(); // Clear the local cache. + // mute/unmute the system's master audio + virtual void setMasterSystemAudioMute(bool mute); + virtual bool getMasterSystemAudioMute(); + protected: virtual bool initWindow(); // Initialize the viewer's window. virtual bool initLogging(); // Initialize log files, logging system, return false on failure. diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 1282e437f2..cc38a0940c 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -444,6 +444,20 @@ std::string LLAppViewerMacOSX::generateSerialNumber() return serial_md5; } +//virtual +void LLAppViewerMacOSX::setMasterSystemAudioMute(bool mute) +{ + // XXX TODO: make this actually set the OS's audio mute state + gSavedSettings.setBOOL("MuteAudio", mute); +} + +//virtual +bool LLAppViewerMacOSX::getMasterSystemAudioMute() +{ + // XXX TODO: make this actually get the OS's audio mute state + return gSavedSettings.getBOOL("MuteAudio"); +} + OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) { OSErr result = noErr; diff --git a/indra/newview/llappviewermacosx.h b/indra/newview/llappviewermacosx.h index bc841fc3a7..cbf7e6c209 100644 --- a/indra/newview/llappviewermacosx.h +++ b/indra/newview/llappviewermacosx.h @@ -48,6 +48,9 @@ public: // virtual bool init(); // Override to do application initialization + // mute/unmute the system's master audio + virtual void setMasterSystemAudioMute(bool mute); + virtual bool getMasterSystemAudioMute(); protected: virtual bool restoreErrorTrap(); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 8a36475510..bff32af228 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -354,7 +354,7 @@ void LLStatusBar::refresh() childSetEnabled("stat_btn", net_stats_visible); // update the master volume button state - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); + bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); mBtnVolume->setToggleState(mute_audio); } @@ -523,8 +523,8 @@ void LLStatusBar::onMouseEnterVolume(LLUICtrl* ctrl) static void onClickVolume(void* data) { // toggle the master mute setting - BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); - gSavedSettings.setBOOL("MuteAudio", !mute_audio); + bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); + LLAppViewer::instance()->setMasterSystemAudioMute(!mute_audio); } // sets the static variables necessary for the date -- cgit v1.2.3 From e70d7fca4b55d15547082a67101d5f8935d3a40a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:04:02 -0800 Subject: CID-155 Checker: OVERRUN_DYNAMIC Function: LLImageGL::updatePickMask(int, int, const unsigned char *) File: /indra/llrender/llimagegl.cpp not a bug, AFAICT. --- indra/llrender/llimagegl.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 46478ba3c9..8bcc4723ae 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1716,10 +1716,7 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) { U32 pick_idx = pick_bit/8; U32 pick_offset = pick_bit%8; - if (pick_idx >= size) - { - llerrs << "WTF?" << llendl; - } + llassert(pick_idx < size); mPickMask[pick_idx] |= 1 << pick_offset; } -- cgit v1.2.3 From 78f725cb97cd05e5c716b0014b3cb4d30066d1ca Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:08:40 -0800 Subject: CID-161 Checker: OVERRUN_STATIC Function: LLViewerLogin::setGridChoice(EGridInfo) File: /indra/newview/llviewernetwork.cpp not a bug. clarified for coverity. --- indra/newview/llviewernetwork.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index d7b55d7e97..987d23630a 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -169,6 +169,7 @@ void LLViewerLogin::setGridChoice(EGridInfo grid) if(grid < 0 || grid >= GRID_INFO_COUNT) { llerrs << "Invalid grid index specified." << llendl; + return; } if(mGridChoice != grid || gSavedSettings.getS32("ServerChoice") != grid) -- cgit v1.2.3 From 68422d9505ecf78e793bb5fb29eb8db58e6b6f89 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:15:02 -0800 Subject: CID 159 CID 158 CID 157 Checker: OVERRUN_STATIC Function: LLVertexBuffer::drawRange(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) const File: /indra/llrender/llvertexbuffer.cpp --- indra/llrender/llvertexbuffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 572ae13909..ecfe845b34 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -237,7 +237,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi llerrs << "Wrong vertex buffer bound." << llendl; } - if (mode > LLRender::NUM_MODES) + if (mode >= LLRender::NUM_MODES) { llerrs << "Invalid draw mode: " << mode << llendl; return; @@ -267,7 +267,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const llerrs << "Wrong vertex buffer bound." << llendl; } - if (mode > LLRender::NUM_MODES) + if (mode >= LLRender::NUM_MODES) { llerrs << "Invalid draw mode: " << mode << llendl; return; @@ -292,7 +292,7 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const llerrs << "Wrong vertex buffer bound." << llendl; } - if (mode > LLRender::NUM_MODES) + if (mode >= LLRender::NUM_MODES) { llerrs << "Invalid draw mode: " << mode << llendl; return; -- cgit v1.2.3 From f257f26746eb68e5d192021120e1818800a626a3 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:27:57 -0800 Subject: CID 201 Checker: RESOURCE_LEAK Function: LLInitialWearablesFetch::processWearablesMessage() File: /indra/newview/llagentwearables.cpp --- indra/newview/llagentwearables.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c21cdf9508..acb9e2ebb1 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2527,8 +2527,13 @@ void LLInitialWearablesFetch::processWearablesMessage() { llinfos << "Invalid wearable, type " << wearable_data->mType << " itemID " << wearable_data->mItemID << " assetID " << wearable_data->mAssetID << llendl; + delete wearable_data; } } + else + { + delete wearable_data; + } // Add all current attachments to the requested items as well. LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); -- cgit v1.2.3 From 744def1ae9520a5085057b94f7053bca1b03ddee Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:34:07 -0800 Subject: CID-200 Checker: RESOURCE_LEAK Function: LLPanelEstateInfo::onKickUserCommit(const std::vector, std::allocator>, std::allocator, std::allocator>>> &, std::vector>&) File: /indra/newview/llfloaterregioninfo.cpp we don't use this structure, all the way back to 1.23 --- indra/newview/llfloaterregioninfo.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 85353ce308..d54736e942 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -1521,11 +1521,6 @@ void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data) //--------------------------------------------------------------------------- // Kick from estate methods //--------------------------------------------------------------------------- -struct LLKickFromEstateInfo -{ - LLPanelEstateInfo *mEstatePanelp; - LLUUID mAgentID; -}; void LLPanelEstateInfo::onClickKickUser() { @@ -1547,11 +1542,6 @@ void LLPanelEstateInfo::onKickUserCommit(const std::vector& names, return; } - //keep track of what user they want to kick and other misc info - LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo(); - kick_info->mEstatePanelp = this; - kick_info->mAgentID = ids[0]; - //Bring up a confirmation dialog LLSD args; args["EVIL_USER"] = names[0]; -- cgit v1.2.3 From 0345701368d9c125c801b98d8f8c0621429e90b5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:37:59 -0800 Subject: CID-199 Checker: RESOURCE_LEAK Function: LLTaskInvFVBridge::removeItem() File: /indra/newview/llpanelobjectinventory.cpp we haven't actually used this new()'d structure, all the way back to 1.23 :/ --- indra/newview/llpanelobjectinventory.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index d4376550d6..5c5c35141e 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -463,10 +463,6 @@ BOOL LLTaskInvFVBridge::removeItem() } else { - remove_data_t* data = new remove_data_t; - data->first = mPanel; - data->second.first = mPanel->getTaskUUID(); - data->second.second.push_back(mUUID); LLSD payload; payload["task_id"] = mPanel->getTaskUUID(); payload["inventory_ids"].append(mUUID); -- cgit v1.2.3 From da3ee22daad52806bbf788a4acee7e7a653ef7d3 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:39:59 -0800 Subject: CID-198 Checker: RESOURCE_LEAK Function: LLTextureFetchWorker::doWork(int) File: /indra/newview/lltexturefetch.cpp --- indra/newview/lltexturefetch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 5ce6884239..404b79bfaf 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -661,6 +661,8 @@ bool LLTextureFetchWorker::doWork(S32 param) } setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); mState = SEND_HTTP_REQ; + delete responder; + responder = NULL; } } -- cgit v1.2.3 From 45e15b0b50bca05aba333d9f2a41748bfc1e9496 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:42:32 -0800 Subject: CID-197 Checker: RESOURCE_LEAK Function: LLToolDragAndDrop::giveInventoryCategory(const LLUUID &, LLInventoryCategory *, const LLUUID &) File: /indra/newview/lltooldraganddrop.cpp --- indra/newview/lltooldraganddrop.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 4420b046d8..125c62474e 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1404,18 +1404,6 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, gFloaterTools->dirty(); } -struct LLGiveInventoryInfo -{ - LLUUID mToAgentID; - LLUUID mInventoryObjectID; - LLUUID mIMSessionID; - LLGiveInventoryInfo(const LLUUID& to_agent, const LLUUID& obj_id, const LLUUID &im_session_id = LLUUID::null) : - mToAgentID(to_agent), - mInventoryObjectID(obj_id), - mIMSessionID(im_session_id) - {} -}; - void LLToolDragAndDrop::giveInventory(const LLUUID& to_agent, LLInventoryItem* item, const LLUUID& im_session_id) @@ -1584,8 +1572,6 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent, } else { - LLGiveInventoryInfo* info = NULL; - info = new LLGiveInventoryInfo(to_agent, cat->getUUID(), im_session_id); LLSD args; args["COUNT"] = llformat("%d",giveable.countNoCopy()); LLSD payload; -- cgit v1.2.3 From f8f34c14c4913d008182a5853613ffbf154d9a26 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:45:44 -0800 Subject: follow-up fix to leak fix. --- indra/newview/llagentwearables.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index acb9e2ebb1..401d74c4ef 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2530,10 +2530,6 @@ void LLInitialWearablesFetch::processWearablesMessage() delete wearable_data; } } - else - { - delete wearable_data; - } // Add all current attachments to the requested items as well. LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); -- cgit v1.2.3 From b6684dce80db985803c7866c6955d1ca896b1b5c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:54:06 -0800 Subject: CID-196 Checker: RESOURCE_LEAK Function: process_improved_im(LLMessageSystem *, void **) File: /indra/newview/llviewermessage.cpp partial fix. either coverity doesn't grok that the remaining case gets freed way down the line by the callbacks, or.. it really doesnt. --- indra/newview/llpanelgroup.cpp | 8 ++++---- indra/newview/llviewermessage.cpp | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 1d447a22d7..ac58c35b06 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -560,10 +560,10 @@ void LLPanelGroup::chatGroup() } void LLPanelGroup::showNotice(const std::string& subject, - const std::string& message, - const bool& has_inventory, - const std::string& inventory_name, - LLOfferInfo* inventory_offer) + const std::string& message, + const bool& has_inventory, + const std::string& inventory_name, + LLOfferInfo* inventory_offer) { LLPanelGroupNotices* panel_notices = findChild("group_notices_tab_panel"); if(!panel_notices) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 36710e7532..764c54da1a 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1987,6 +1987,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLPanelGroup::showNotice(subj,mes,group_id,has_inventory,item_name,info); } + else + { + delete info; + } } break; case IM_GROUP_INVITATION: -- cgit v1.2.3 From 576c69dfd9b4418263caa7e14d2d3e52ea8cf5e4 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 14:57:02 -0800 Subject: CID-196 Checker: RESOURCE_LEAK Function: process_improved_im(LLMessageSystem *, void **) File: /indra/newview/llviewermessage.cpp --- indra/newview/llviewermessage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 764c54da1a..29b7324a0d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2051,6 +2051,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (sizeof(offer_agent_bucket_t) != binary_bucket_size) { LL_WARNS("Messaging") << "Malformed inventory offer from agent" << LL_ENDL; + delete info; break; } bucketp = (struct offer_agent_bucket_t*) &binary_bucket[0]; @@ -2062,6 +2063,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (sizeof(S8) != binary_bucket_size) { LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL; + delete info; break; } info->mType = (LLAssetType::EType) binary_bucket[0]; -- cgit v1.2.3 From 7dc1e2eedbf29396b6614f8e7e39b7938dd5e301 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:04:12 -0800 Subject: CID-195 Checker: RESOURCE_LEAK Function: LLAgentWearables::addLocalTextureObject(EWearableType, LLVOAvatarDefines::ETextureIndex, unsigned int) File: /indra/newview/llagentwearables.cpp --- indra/newview/llagentwearables.cpp | 3 ++- indra/newview/llwearable.cpp | 4 ++-- indra/newview/llwearable.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 401d74c4ef..b0ff3a5626 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1130,8 +1130,9 @@ void LLAgentWearables::addLocalTextureObject(const EWearableType wearable_type, if (!wearable) { llerrs << "Tried to add local texture object to invalid wearable with type " << wearable_type << " and index " << wearable_index << llendl; + return; } - LLLocalTextureObject* lto = new LLLocalTextureObject(); + LLLocalTextureObject lto; wearable->setLocalTextureObject(texture_type, lto); } diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index b789bd3650..8cfb8b1103 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -818,7 +818,7 @@ const LLLocalTextureObject* LLWearable::getConstLocalTextureObject(S32 index) co return NULL; } -void LLWearable::setLocalTextureObject(S32 index, LLLocalTextureObject *lto) +void LLWearable::setLocalTextureObject(S32 index, LLLocalTextureObject <o) { if( mTEMap.find(index) != mTEMap.end() ) { @@ -826,7 +826,7 @@ void LLWearable::setLocalTextureObject(S32 index, LLLocalTextureObject *lto) } if( lto ) { - mTEMap[index] = new LLLocalTextureObject(*lto); + mTEMap[index] = new LLLocalTextureObject(lto); } } diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 7a579b248e..dae983bcf3 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -114,7 +114,7 @@ public: LLLocalTextureObject* getLocalTextureObject(S32 index); const LLLocalTextureObject* getConstLocalTextureObject(S32 index) const; - void setLocalTextureObject(S32 index, LLLocalTextureObject *lto); + void setLocalTextureObject(S32 index, LLLocalTextureObject <o); void addVisualParam(LLVisualParam *param); void setVisualParams(); void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake); -- cgit v1.2.3 From c5abe04923c8968c38fbca67182d7e3fbd0723d9 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:07:04 -0800 Subject: CID-188 Checker: RESOURCE_LEAK Function: LLTemplateParser::LLTemplateParser(LLTemplateTokenizer &) File: /indra/llmessage/llmessagetemplateparser.cpp --- indra/llmessage/llmessagetemplateparser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llmessage/llmessagetemplateparser.cpp b/indra/llmessage/llmessagetemplateparser.cpp index 283547ea00..2ddbf3e0df 100644 --- a/indra/llmessage/llmessagetemplateparser.cpp +++ b/indra/llmessage/llmessagetemplateparser.cpp @@ -403,6 +403,10 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens): { mMessages.push_back(templatep); } + else + { + delete templatep; + } } if(!tokens.wantEOF()) -- cgit v1.2.3 From 635290cc8774f0db67d2ee633d287ecf7d767907 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:09:25 -0800 Subject: CID-186 Checker: RESOURCE_LEAK Function: LLStringUtilBase::addCRLF(std::basic_string, std::allocator>&) File: /indra/llcommon/llstring.h --- indra/llcommon/llstring.h | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 31e70e0fe4..62cedcde4e 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -882,6 +882,7 @@ void LLStringUtilBase::addCRLF(std::basic_string& string) } string.assign(t, size); + delete[] t; } } -- cgit v1.2.3 From fa886566b66639d65db4a7d4399cdbf2552a3d50 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:10:34 -0800 Subject: CID-184 Checker: RESOURCE_LEAK Function: LLPluginProcessChild::receiveMessageRaw(const std::basic_string, std::allocator>&) File: /indra/llplugin/llpluginprocesschild.cpp --- indra/llplugin/llpluginprocesschild.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 07fc82c770..11c924cadf 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -359,6 +359,7 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message) else { LL_WARNS("Plugin") << "Couldn't create a shared memory segment!" << LL_ENDL; + delete region; } } -- cgit v1.2.3 From 43218577740fa97a99160008568e6e0a36f892e5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:37:28 -0800 Subject: CID-220 Checker: STREAM_FORMAT_STATE Function: encode_character(std::basic_ostream>&, char) File: /indra/llcommon/lluri.cpp --- indra/llcommon/lluri.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index f6e8f01f0e..9d4f3a98f0 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -46,10 +46,21 @@ void encode_character(std::ostream& ostr, std::string::value_type val) { - ostr << "%" << std::uppercase << std::hex << std::setw(2) << std::setfill('0') + ostr << "%" + + << std::uppercase + << std::hex + << std::setw(2) + << std::setfill('0') + // VWR-4010 Cannot cast to U32 because sign-extension on // chars > 128 will result in FFFFFFC3 instead of F3. - << static_cast(static_cast(val)); + << static_cast(static_cast(val)) + + // reset stream state + << std::nouppercase + << std::dec + << std::setfill(' '); } // static -- cgit v1.2.3 From a7c3fde789b0f15f0ccf650e59dc352451fc4e4a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:45:07 -0800 Subject: partial fix for CID-219 Checker: STREAM_FORMAT_STATE Function: LLDate::toStream(std::basic_ostream>&) const File: /indra/llcommon/lldate.cpp --- indra/llcommon/lldate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index ca7e471bf2..e3323fcfbf 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -152,7 +152,8 @@ void LLDate::toStream(std::ostream& s) const s << '.' << std::setw(2) << (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100)); } - s << 'Z'; + s << 'Z' + << setfill(' '); } bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const -- cgit v1.2.3 From 9e2ba40d13cd03525ce137435fd817a55758bc8c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:45:41 -0800 Subject: less dumb partial fix for CID-219 --- indra/llcommon/lldate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index e3323fcfbf..de7f2ead74 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -153,7 +153,7 @@ void LLDate::toStream(std::ostream& s) const << (int)(exp_time.tm_usec / (LL_APR_USEC_PER_SEC / 100)); } s << 'Z' - << setfill(' '); + << std::setfill(' '); } bool LLDate::split(S32 *year, S32 *month, S32 *day, S32 *hour, S32 *min, S32 *sec) const -- cgit v1.2.3 From e133a9824695d0286ca7717b1eb6a1c57748b898 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:49:22 -0800 Subject: CID-227 Checker: STRING_OVERFLOW Function: CProcessor::AnalyzeIntelProcessor() File: /indra/llcommon/llprocessor.cpp --- indra/llcommon/llprocessor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 469e544b16..8a4a4a8f9a 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -281,7 +281,8 @@ bool CProcessor::AnalyzeIntelProcessor() // already have a string here from GetCPUInfo(). JC if ( CPUInfo.uiBrandID < LL_ARRAY_SIZE(INTEL_BRAND) ) { - strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]); + strncpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID], sizeof(CPUInfo.strBrandID)-1); + CPUInfo.strBrandID[sizeof(CPUInfo.strBrandID)-1]='\0'; if (CPUInfo.uiBrandID == 3 && CPUInfo.uiModel == 6) { -- cgit v1.2.3 From e7c17cb29b63fb85bf345133ed78a026a224af30 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:53:56 -0800 Subject: a follow-up fix. --- indra/newview/llwearable.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 8cfb8b1103..d093031bea 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -824,10 +824,7 @@ void LLWearable::setLocalTextureObject(S32 index, LLLocalTextureObject <o) { mTEMap.erase(index); } - if( lto ) - { - mTEMap[index] = new LLLocalTextureObject(lto); - } + mTEMap[index] = new LLLocalTextureObject(lto); } -- cgit v1.2.3 From 94e5625f2c5bfef9d6cd7e5ffdda3a0e64717d93 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:58:02 -0800 Subject: CID-255 Checker: UNINIT Function: process_improved_im(LLMessageSystem *, void **) File: /indra/newview/llviewermessage.cpp --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 29b7324a0d..aa77c9602f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1933,7 +1933,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if (has_inventory) { - info = new LLOfferInfo; + info = new LLOfferInfo(); info->mIM = IM_GROUP_NOTICE; info->mFromID = from_id; -- cgit v1.2.3 From b3c1d0dc07a16b47626968ae55b5e6a725d8d722 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 15:59:56 -0800 Subject: CID-254 Checker: UNINIT Function: LLCacheName::Impl::processUUIDRequest(LLMessageSystem *, bool) File: /indra/llmessage/llcachename.cpp --- indra/llmessage/llcachename.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 3078d80552..dbec2816c8 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -125,7 +125,7 @@ private: }; ReplySender::ReplySender(LLMessageSystem* msg) - : mMsg(msg), mPending(false) + : mMsg(msg), mPending(false), mCurrIsGroup(false) { } ReplySender::~ReplySender() -- cgit v1.2.3 From 1afc7ecc142c9ec066e5761497a4011698b50c8e Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:11:32 -0800 Subject: CID-388 Checker: UNINIT_CTOR Function: LLPanelPlaceInfo::LLPanelPlaceInfo() File: /indra/newview/llpanelplaceinfo.cpp --- indra/newview/llpanellandmarkinfo.cpp | 2 +- indra/newview/llpanellandmarkinfo.h | 2 +- indra/newview/llpanelplaceinfo.cpp | 3 ++- indra/newview/llpanelplaceinfo.h | 8 +++++--- indra/newview/llpanelplaceprofile.cpp | 2 +- indra/newview/llpanelplaceprofile.h | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index c792fd4fe3..7a17d4a1f0 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -108,7 +108,7 @@ void LLPanelLandmarkInfo::resetLocation() } // virtual -void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type) +void LLPanelLandmarkInfo::setInfoType(EInfoType type) { LLPanel* landmark_info_panel = getChild("landmark_info_panel"); diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 2a9949ae41..b3dc3f5ad9 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -49,7 +49,7 @@ public: /*virtual*/ void resetLocation(); - /*virtual*/ void setInfoType(INFO_TYPE type); + /*virtual*/ void setInfoType(EInfoType type); /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 5f75668722..9ebc8ca2b9 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -58,6 +58,7 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() mPosRegion(), mScrollingPanelMinHeight(0), mScrollingPanelWidth(0), + mInfoType(UNKNOWN), mScrollingPanel(NULL), mScrollContainer(NULL) {} @@ -120,7 +121,7 @@ void LLPanelPlaceInfo::setParcelID(const LLUUID& parcel_id) } //virtual -void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) +void LLPanelPlaceInfo::setInfoType(EInfoType type) { mTitle->setText(mCurrentTitle); diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 3091f7ed24..deedbd2b0f 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -54,8 +54,10 @@ class LLViewerInventoryCategory; class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver { public: - enum INFO_TYPE + enum EInfoType { + UNKNOWN, + AGENT, CREATE_LANDMARK, LANDMARK, @@ -79,7 +81,7 @@ public: // Depending on how the panel was triggered // (from landmark or current location, or other) // sets a corresponding title and contents. - virtual void setInfoType(INFO_TYPE type); + virtual void setInfoType(EInfoType type); // Requests remote parcel info by parcel ID. void sendParcelInfoRequest(); @@ -114,7 +116,7 @@ protected: std::string mCurrentTitle; S32 mScrollingPanelMinHeight; S32 mScrollingPanelWidth; - INFO_TYPE mInfoType; + EInfoType mInfoType; LLScrollContainer* mScrollContainer; LLPanel* mScrollingPanel; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 3c798639d4..8d689b2c5e 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -207,7 +207,7 @@ void LLPanelPlaceProfile::resetLocation() } // virtual -void LLPanelPlaceProfile::setInfoType(INFO_TYPE type) +void LLPanelPlaceProfile::setInfoType(EInfoType type) { bool is_info_type_agent = type == AGENT; diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index 8ca9526875..e77b441567 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -48,7 +48,7 @@ public: /*virtual*/ void resetLocation(); - /*virtual*/ void setInfoType(INFO_TYPE type); + /*virtual*/ void setInfoType(EInfoType type); /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); -- cgit v1.2.3 From 23147ee1ee3fd37025fb777507a8e19810d94f3b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:13:11 -0800 Subject: CID-387 Checker: UNINIT_CTOR Function: LLTeleportHistoryPanel::ContextMenu::ContextMenu() File: /indra/newview/llpanelteleporthistory.cpp --- indra/newview/llpanelteleporthistory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 1b8fb49641..6005881148 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -308,7 +308,7 @@ void LLTeleportHistoryFlatItemStorage::purge() //////////////////////////////////////////////////////////////////////////////// LLTeleportHistoryPanel::ContextMenu::ContextMenu() : - mMenu(NULL) + mMenu(NULL), mIndex(0) { } -- cgit v1.2.3 From 7814eaec0082dfc505076afca33b51eeb6f591fe Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:16:28 -0800 Subject: CID-386 Checker: UNINIT_CTOR Function: LLFolderBridge::LLFolderBridge(LLInventoryPanel *, const LLUUID &) File: /indra/newview/llinventorybridge.h --- indra/newview/llinventorybridge.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 759d0cba18..eeb8246b11 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -320,8 +320,12 @@ public: LLViewerInventoryCategory* getCategory() const; protected: - LLFolderBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : - LLInvFVBridge(inventory, uuid), mCallingCards(FALSE), mWearables(FALSE) {} + LLFolderBridge(LLInventoryPanel* inventory, const LLUUID& uuid) + : LLInvFVBridge(inventory, uuid), + + mCallingCards(FALSE), + mWearables(FALSE), + mMenu(NULL) {} // menu callbacks static void pasteClipboard(void* user_data); -- cgit v1.2.3 From bfda8b2cfee5512f6737ea2802b69bdac66ed3ab Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:19:32 -0800 Subject: CID-385 Checker: UNINIT_CTOR Function: LLToolBar::LLToolBar() File: /indra/newview/lltoolbar.cpp --- indra/newview/lltoolbar.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index edbaa0d45a..6df574a21a 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -95,9 +95,12 @@ F32 LLToolBar::sInventoryAutoOpenTime = 1.f; // LLToolBar::LLToolBar() -: LLPanel() + : LLPanel(), + + mInventoryAutoOpen(FALSE), + mNumUnreadIMs(0) #if LL_DARWIN - , mResizeHandle(NULL) + , mResizeHandle(NULL), #endif // LL_DARWIN { setIsChrome(TRUE); -- cgit v1.2.3 From bfd21c0886ccb9ebbb1f32785b008134c20e3de5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:20:44 -0800 Subject: CID-384 Checker: UNINIT_CTOR Function: LLSelectNode::LLSelectNode(const LLSelectNode&) File: /indra/newview/llselectmgr.cpp --- indra/newview/llselectmgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 60a095506b..6f76715e73 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5093,6 +5093,7 @@ LLSelectNode::LLSelectNode(const LLSelectNode& nodep) mName = nodep.mName; mDescription = nodep.mDescription; mCategory = nodep.mCategory; + mInventorySerial = 0; mSavedPositionLocal = nodep.mSavedPositionLocal; mSavedPositionGlobal = nodep.mSavedPositionGlobal; mSavedScale = nodep.mSavedScale; -- cgit v1.2.3 From 344eaeb39bc8fa059960d44b0b0853d92530c411 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:27:02 -0800 Subject: CID-376 Checker: UNINIT_CTOR Function: LLViewerPart::LLViewerPart() File: /indra/newview/llviewerpartsim.cpp --- indra/newview/llviewerpartsim.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 841a7ccc5e..6b480ccf8e 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -81,6 +81,7 @@ F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale) LLViewerPart::LLViewerPart() : mPartID(0), mLastUpdateTime(0.f), + mSkipOffset(0.f), mVPCallback(NULL), mImagep(NULL) { -- cgit v1.2.3 From 0ea467ad06acc8e90f46cf9b97d1509e287bbe5d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:31:41 -0800 Subject: CID-375 Checker: UNINIT_CTOR Function: LLViewerFetchedTexture::LLViewerFetchedTexture(const LLImageRaw *, int) File: /indra/newview/llviewertexture.cpp --- indra/newview/llviewertexture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index b80dc7d902..0ad269392d 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1029,6 +1029,8 @@ void LLViewerFetchedTexture::init(bool firstinit) // does not contain this image. mIsMissingAsset = FALSE; + mLoadedCallbackDesiredDiscardLevel = 0; + mNeedsCreateTexture = FALSE; mIsRawImageValid = FALSE; @@ -1041,6 +1043,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mFetchPriority = 0; mDownloadProgress = 0.f; mFetchDeltaTime = 999999.f; + mRequestDeltaTime = 0.f; mForSculpt = FALSE ; mIsFetched = FALSE ; -- cgit v1.2.3 From 73d92f0847936f51fc0e8f12140d0880f73a2b11 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:38:02 -0800 Subject: CID-374 Checker: UNINIT_CTOR Function: LLPickInfo::LLPickInfo(const LLCoordGL &, unsigned int, int, int, void (*)(const LLPickInfo&)) File: /indra/newview/llviewerwindow.cpp remove some fat, dead members. --- indra/newview/llviewerwindow.cpp | 8 ++++---- indra/newview/llviewerwindow.h | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 424b84a756..b4c73dba26 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4849,10 +4849,10 @@ LLPickInfo::LLPickInfo() } LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos, - MASK keyboard_mask, - BOOL pick_transparent, - BOOL pick_uv_coords, - void (*pick_callback)(const LLPickInfo& pick_info)) + MASK keyboard_mask, + BOOL pick_transparent, + BOOL pick_uv_coords, + void (*pick_callback)(const LLPickInfo& pick_info)) : mMousePt(mouse_pos), mKeyMask(keyboard_mask), mPickCallback(pick_callback), diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index b488276a18..c0a9180b53 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -126,9 +126,6 @@ private: void updateXYCoords(); BOOL mWantSurfaceInfo; // do we populate mUVCoord, mNormal, mBinormal? - U8 mPickBuffer[PICK_DIAMETER * PICK_DIAMETER * 4]; - F32 mPickDepthBuffer[PICK_DIAMETER * PICK_DIAMETER]; - BOOL mPickParcelWall; }; -- cgit v1.2.3 From 373f6264082256a5c7877fb8b99336bf9cf1ca6b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:41:11 -0800 Subject: CID-373 Checker: UNINIT_CTOR Function: LLTexLayerSet::LLTexLayerSet(LLVOAvatarSelf *) File: /indra/newview/lltexlayer.cpp --- indra/newview/lltexlayer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index b8419e088a..ddb6405c41 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -567,6 +567,7 @@ LLTexLayerSet::LLTexLayerSet(LLVOAvatarSelf* const avatar) : mAvatar( avatar ), mUpdatesEnabled( FALSE ), mIsVisible( TRUE ), + mBakedTexIndex(LLVOAvatarDefines::BAKED_HEAD), mInfo( NULL ) { } -- cgit v1.2.3 From f2e202e6a4bd033e3d9aad3197f5aa491076245b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:43:48 -0800 Subject: CID-368 Checker: UNINIT_CTOR Function: LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject *, LLFlexibleObjectData *) File: /indra/newview/llflexibleobject.cpp --- indra/newview/llflexibleobject.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index fc8790c172..aea2de8e92 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -66,6 +66,7 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD mInitializedRes = -1; mSimulateRes = 0; mFrameNum = 0; + mCollisionSphereRadius = 0.f; mRenderRes = 1; if(mVO->mDrawable.notNull()) -- cgit v1.2.3 From 8bf32990fcb2426a9d177da6db631a0eda2d3219 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:45:42 -0800 Subject: CID-367 Checker: UNINIT_CTOR Function: LLFace::LLFace(LLDrawable *, LLViewerObject *) File: /indra/newview/llface.h --- indra/newview/llface.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index eef774426a..965ac1cad0 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -157,6 +157,7 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mGeomIndex = 0; mIndicesCount = 0; mIndicesIndex = 0; + mIndexInTex = 0; mTexture = NULL; mTEOffset = -1; -- cgit v1.2.3 From 6c92a724a1893eceac644a65ff5660e73ba6d42e Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 27 Jan 2010 16:48:09 -0800 Subject: Implemented LLAppViewerMacOSX::setMasterSystemAudioMute() and LLAppViewerMacOSX::getMasterSystemAudioMute() using CoreAudio APIs. This required adding a reference to the CoreAudio framework in indra/newview/CMakeLists.txt --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llappviewermacosx.cpp | 50 +++++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7ddeb90d29..4c0c895a7d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1064,11 +1064,13 @@ if (DARWIN) find_library(APPKIT_LIBRARY AppKit) find_library(COCOA_LIBRARY Cocoa) find_library(IOKIT_LIBRARY IOKit) + find_library(COREAUDIO_LIBRARY CoreAudio) set(viewer_LIBRARIES ${COCOA_LIBRARY} ${AGL_LIBRARY} ${IOKIT_LIBRARY} + ${COREAUDIO_LIBRARY} ) # Add resource files to the project. diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index cc38a0940c..f8f8f50cd6 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -50,6 +50,7 @@ #include #include "lldir.h" #include +#include // for systemwide mute class LLMediaCtrl; // for LLURLDispatcher namespace @@ -444,18 +445,57 @@ std::string LLAppViewerMacOSX::generateSerialNumber() return serial_md5; } +static AudioDeviceID get_default_audio_output_device(void) +{ + AudioDeviceID device = 0; + UInt32 size; + OSStatus err; + + size = sizeof(device); + err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &size, &device); + if(err != noErr) + { + LL_DEBUGS("SystemMute") << "Couldn't get default audio output device (0x" << std::hex << err << ")" << LL_ENDL; + } + + return device; +} + //virtual -void LLAppViewerMacOSX::setMasterSystemAudioMute(bool mute) +void LLAppViewerMacOSX::setMasterSystemAudioMute(bool new_mute) { - // XXX TODO: make this actually set the OS's audio mute state - gSavedSettings.setBOOL("MuteAudio", mute); + AudioDeviceID device = get_default_audio_output_device(); + + if(device != 0) + { + UInt32 mute = new_mute; + OSStatus err = AudioDeviceSetProperty(device, NULL, 0, false, kAudioDevicePropertyMute, sizeof(mute), &mute); + if(err != noErr) + { + LL_INFOS("SystemMute") << "Couldn't set audio mute property (0x" << std::hex << err << ")" << LL_ENDL; + } + } } //virtual bool LLAppViewerMacOSX::getMasterSystemAudioMute() { - // XXX TODO: make this actually get the OS's audio mute state - return gSavedSettings.getBOOL("MuteAudio"); + // Assume the system isn't muted + UInt32 mute = 0; + + AudioDeviceID device = get_default_audio_output_device(); + + if(device != 0) + { + UInt32 size = sizeof(mute); + OSStatus err = AudioDeviceGetProperty(device, 0, false, kAudioDevicePropertyMute, &size, &mute); + if(err != noErr) + { + LL_DEBUGS("SystemMute") << "Couldn't get audio mute property (0x" << std::hex << err << ")" << LL_ENDL; + } + } + + return (mute != 0); } OSErr AEGURLHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) -- cgit v1.2.3 From 63aef899bc6274d2b7fd90de8ed7e01cb6bb7359 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:49:51 -0800 Subject: CID-365 Checker: UNINIT_CTOR Function: LLSurfacePatch::LLSurfacePatch() File: /indra/newview/llsurfacepatch.cpp --- indra/newview/llsurfacepatch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 0ce794addb..48e4a6ccc7 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -60,6 +60,7 @@ LLSurfacePatch::LLSurfacePatch() : mHeightsGenerated(FALSE), mDataOffset(0), mDataZ(NULL), + mDataNorm(NULL), mVObjp(NULL), mOriginRegion(0.f, 0.f, 0.f), mCenterRegion(0.f, 0.f, 0.f), @@ -355,12 +356,14 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) normal %= c2; normal.normVec(); + llassert(mDataNorm); *(mDataNorm + surface_stride * y + x) = normal; } const LLVector3 &LLSurfacePatch::getNormal(const U32 x, const U32 y) const { U32 surface_stride = mSurfacep->getGridsPerEdge(); + llassert(mDataNorm); return *(mDataNorm + surface_stride * y + x); } @@ -402,6 +405,7 @@ void LLSurfacePatch::updateVerticalStats() U32 i, j, k; F32 z, total; + llassert(mDataZ); z = *(mDataZ); mMinZ = z; -- cgit v1.2.3 From 056ca2ae5c1a145483c75e85fa7b1bee746b2627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:51:46 -0800 Subject: CID-359 Checker: UNINIT_CTOR Function: LLLocalTextureObject::LLLocalTextureObject(LLViewerFetchedTexture *, const LLUUID &) File: /indra/newview/lllocaltextureobject.cpp --- indra/newview/lllocaltextureobject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/lllocaltextureobject.cpp b/indra/newview/lllocaltextureobject.cpp index 6bcbe6f58c..69eb5fce2f 100644 --- a/indra/newview/lllocaltextureobject.cpp +++ b/indra/newview/lllocaltextureobject.cpp @@ -47,7 +47,9 @@ LLLocalTextureObject::LLLocalTextureObject() : mImage = NULL; } -LLLocalTextureObject::LLLocalTextureObject(LLViewerFetchedTexture* image, const LLUUID& id) +LLLocalTextureObject::LLLocalTextureObject(LLViewerFetchedTexture* image, const LLUUID& id) : + mIsBakedReady(FALSE), + mDiscard(MAX_DISCARD_LEVEL+1) { mImage = image; gGL.getTexUnit(0)->bind(mImage); -- cgit v1.2.3 From ce436d20f09269dd3715b29a1ed0addb132b35cb Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:53:18 -0800 Subject: CID-360 Checker: UNINIT_CTOR Function: LLViewerVisualParamInfo::LLViewerVisualParamInfo() File: /indra/newview/llviewervisualparam.cpp --- indra/newview/llviewervisualparam.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewervisualparam.cpp b/indra/newview/llviewervisualparam.cpp index b088ef0730..fad398e00b 100644 --- a/indra/newview/llviewervisualparam.cpp +++ b/indra/newview/llviewervisualparam.cpp @@ -46,6 +46,7 @@ LLViewerVisualParamInfo::LLViewerVisualParamInfo() : mWearableType( WT_INVALID ), + mCrossWearable(FALSE), mCamDist( 0.5f ), mCamAngle( 0.f ), mCamElevation( 0.f ), -- cgit v1.2.3 From d9661c3d2a26dd4379a6f57dc8227ee2e73f8ec6 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:57:10 -0800 Subject: CID-358 Checker: UNINIT_CTOR Function: LLTextureCache::Entry::Entry() File: /indra/newview/lltexturecache.h --- indra/newview/lltexturecache.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 4203cbbc43..64ec881fc3 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -59,7 +59,12 @@ private: }; struct Entry { - Entry() {} + Entry() : + mBodySize(0), + mImageSize(0), + mTime(0) + { + } Entry(const LLUUID& id, S32 imagesize, S32 bodysize, U32 time) : mID(id), mImageSize(imagesize), mBodySize(bodysize), mTime(time) {} void init(const LLUUID& id, U32 time) { mID = id, mImageSize = 0; mBodySize = 0; mTime = time; } -- cgit v1.2.3 From 6d68de504f7ffd356f465916fe8bac26de47d5ae Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 16:58:58 -0800 Subject: CID-355 Checker: UNINIT_CTOR Function: LLVOVolume::LLVOVolume(const LLUUID &, unsigned char, LLViewerRegion *) File: /indra/newview/llvovolume.cpp --- indra/newview/llvovolume.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 295c0c8010..bfe38c14ba 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -180,8 +180,10 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mRelativeXform.setIdentity(); mRelativeXformInvTrans.setIdentity(); + mFaceMappingChanged = FALSE; mLOD = MIN_LOD; mTextureAnimp = NULL; + mVolumeChanged = FALSE; mVObjRadius = LLVector3(1,1,0.5f).length(); mNumFaces = 0; mLODChanged = FALSE; -- cgit v1.2.3 From 6e55c9549a31550b7dc73972462334c8b1e32f7c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 17:01:02 -0800 Subject: CID-354 Checker: UNINIT_CTOR Function: LLViewerJointMesh::LLViewerJointMesh() File: /indra/newview/llviewerjointmesh.cpp --- indra/newview/llviewerjointmesh.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 5b8902dec4..1a67fc0966 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -147,6 +147,7 @@ LLViewerJointMesh::LLViewerJointMesh() mTexture( NULL ), mLayerSet( NULL ), mTestImageName( 0 ), + mFaceIndexCount(0), mIsTransparent(FALSE) { -- cgit v1.2.3 From e48e9db756f55f1834256abfcc37038799cca8c0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 17:04:43 -0800 Subject: CID-353 Checker: UNINIT_CTOR Function: LLViewerJoint::LLViewerJoint() File: /indra/newview/llviewerjoint.cpp --- indra/newview/llviewerjoint.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewerjoint.cpp b/indra/newview/llviewerjoint.cpp index c2591ac8d7..c425d95ff8 100644 --- a/indra/newview/llviewerjoint.cpp +++ b/indra/newview/llviewerjoint.cpp @@ -66,6 +66,7 @@ LLViewerJoint::LLViewerJoint() mMinPixelArea = DEFAULT_LOD; mPickName = PN_DEFAULT; mVisible = TRUE; + mMeshID = 0; } -- cgit v1.2.3 From 0d2ce43c545b40a3ce5a90bc894b79ae8b11b726 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 27 Jan 2010 17:06:49 -0800 Subject: CID-348 Checker: UNINIT_CTOR Function: LLViewerShaderMgr::LLViewerShaderMgr() File: /indra/newview/llviewershadermgr.cpp --- indra/newview/llviewershadermgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 6dc9f5c465..86b1a8c910 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -135,7 +135,8 @@ LLGLSLShader gLuminanceGatherProgram; GLint gAvatarMatrixParam; LLViewerShaderMgr::LLViewerShaderMgr() : - mVertexShaderLevel(SHADER_COUNT, 0) + mVertexShaderLevel(SHADER_COUNT, 0), + mMaxAvatarShaderLevel(0) { /// Make sure WL Sky is the first program mShaderList.push_back(&gWLSkyProgram); -- cgit v1.2.3 From 52bd13e1f5cd661ff359e36be8c0496d06c19d1c Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 27 Jan 2010 17:21:16 -0800 Subject: Fix for broken mac build (surplus comma in the LLToolBar constructor initializers). --- indra/newview/lltoolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 6df574a21a..e7dc7ae522 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -100,7 +100,7 @@ LLToolBar::LLToolBar() mInventoryAutoOpen(FALSE), mNumUnreadIMs(0) #if LL_DARWIN - , mResizeHandle(NULL), + , mResizeHandle(NULL) #endif // LL_DARWIN { setIsChrome(TRUE); -- cgit v1.2.3