summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-09-22 13:37:35 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-09-22 13:37:35 +0100
commit240ab6f0dfeb90bf876d76e2a4d4bd38abba2e1b (patch)
treec4ae77d613ed2eee6e9c47b161cd0b3ba9f79ed4 /indra/newview
parenta75f44505abd80ab96504ed8af6d65cdfac658da (diff)
CID-511
Checker: UNINIT_CTOR Function: LLVOCacheEntry::LLVOCacheEntry(LLAPRFile *) File: /indra/newview/llvocache.cpp
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvocache.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 0b903e62b1..d76634663d 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -44,25 +44,27 @@ BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes)
//---------------------------------------------------------------------------
LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp)
+ :
+ mLocalID(local_id),
+ mCRC(crc),
+ mHitCount(0),
+ mDupeCount(0),
+ mCRCChangeCount(0)
{
- mLocalID = local_id;
- mCRC = crc;
- mHitCount = 0;
- mDupeCount = 0;
- mCRCChangeCount = 0;
mBuffer = new U8[dp.getBufferSize()];
mDP.assignBuffer(mBuffer, dp.getBufferSize());
mDP = dp;
}
LLVOCacheEntry::LLVOCacheEntry()
+ :
+ mLocalID(0),
+ mCRC(0),
+ mHitCount(0),
+ mDupeCount(0),
+ mCRCChangeCount(0),
+ mBuffer(NULL)
{
- mLocalID = 0;
- mCRC = 0;
- mHitCount = 0;
- mDupeCount = 0;
- mCRCChangeCount = 0;
- mBuffer = NULL;
mDP.assignBuffer(mBuffer, 0);
}
@@ -73,7 +75,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
success = check_read(apr_file, &mLocalID, sizeof(U32));
if(success)
-{
+ {
success = check_read(apr_file, &mCRC, sizeof(U32));
}
if(success)
@@ -83,27 +85,24 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
if(success)
{
success = check_read(apr_file, &mDupeCount, sizeof(S32));
-}
+ }
if(success)
-{
+ {
success = check_read(apr_file, &mCRCChangeCount, sizeof(S32));
}
if(success)
{
success = check_read(apr_file, &size, sizeof(S32));
- // Corruption in the cache entries
- if ((size > 10000) || (size < 1))
- {
- // We've got a bogus size, skip reading it.
- // We won't bother seeking, because the rest of this file
- // is likely bogus, and will be tossed anyway.
- llwarns << "Bogus cache entry, size " << size << ", aborting!" << llendl;
- mLocalID = 0;
- mCRC = 0;
- mBuffer = NULL;
- return;
- }
+ // Corruption in the cache entries
+ if ((size > 10000) || (size < 1))
+ {
+ // We've got a bogus size, skip reading it.
+ // We won't bother seeking, because the rest of this file
+ // is likely bogus, and will be tossed anyway.
+ llwarns << "Bogus cache entry, size " << size << ", aborting!" << llendl;
+ success = FALSE;
+ }
}
if(success && size > 0)
{
@@ -112,8 +111,8 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
if(success)
{
- mDP.assignBuffer(mBuffer, size);
-}
+ mDP.assignBuffer(mBuffer, size);
+ }
else
{
delete[] mBuffer ;
@@ -125,6 +124,9 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
{
mLocalID = 0;
mCRC = 0;
+ mHitCount = 0;
+ mDupeCount = 0;
+ mCRCChangeCount = 0;
mBuffer = NULL;
}
}