diff options
author | Steven Bennetts <steve@lindenlab.com> | 2007-01-10 22:23:45 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2007-01-10 22:23:45 +0000 |
commit | 46444df6ded3c31bd874b36a55e95dfb01a81f0b (patch) | |
tree | f2b448938b0d588e137ff2a8ab01019ba1521fc8 /indra/llaudio | |
parent | 0fe36daf5636db0e3d1efad7824419924704eaf0 (diff) |
merge -r 56266 release-candidate
merge -r 56301 release-candidate
Fixes for llxfer.cpp and llaudiodecodemgr.cpp (asset upload truncation bug)
Diffstat (limited to 'indra/llaudio')
-rw-r--r-- | indra/llaudio/llaudiodecodemgr.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index a819a9fa03..a2a594f2eb 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -31,7 +31,7 @@ extern LLAudioEngine *gAudiop; LLAudioDecodeMgr *gAudioDecodeMgrp = NULL; -const S32 wav_header_size = 44; +static const S32 WAV_HEADER_SIZE = 44; class LLVorbisDecodeState { @@ -356,7 +356,7 @@ BOOL LLVorbisDecodeState::initDecode() size_guess *= 2; size_guess += 2048; mWAVBuffer.reserve(size_guess); - mWAVBuffer.resize(wav_header_size); + mWAVBuffer.resize(WAV_HEADER_SIZE); { // write the .wav format header @@ -506,7 +506,7 @@ BOOL LLVorbisDecodeState::finishDecode() ov_clear(&mVF); // write "data" chunk length, in little-endian format - S32 data_length = mWAVBuffer.size() - wav_header_size; + S32 data_length = mWAVBuffer.size() - WAV_HEADER_SIZE; mWAVBuffer[40] = (data_length) & 0x000000FF; mWAVBuffer[41] = (data_length >> 8) & 0x000000FF; mWAVBuffer[42] = (data_length >> 16) & 0x000000FF; @@ -529,9 +529,9 @@ BOOL LLVorbisDecodeState::finishDecode() char pcmout[4096]; /*Flawfinder: ignore*/ fade_length = llmin((S32)128,(S32)(data_length-36)/8); - if (sizeof(mWAVBuffer) >= (wav_header_size + 2* fade_length)) + if((S32)mWAVBuffer.size() >= (WAV_HEADER_SIZE + 2* fade_length)) { - memcpy(pcmout, &mWAVBuffer[wav_header_size], (2 * fade_length)); /*Flawfinder: ignore*/ + memcpy(pcmout, &mWAVBuffer[WAV_HEADER_SIZE], (2 * fade_length)); /*Flawfinder: ignore*/ } llendianswizzle(&pcmout, 2, fade_length); @@ -543,12 +543,12 @@ BOOL LLVorbisDecodeState::finishDecode() } llendianswizzle(&pcmout, 2, fade_length); - if ((wav_header_size+(2 * fade_length)) < sizeof(mWAVBuffer)) + if((WAV_HEADER_SIZE+(2 * fade_length)) < (S32)mWAVBuffer.size()) { - memcpy(&mWAVBuffer[wav_header_size], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/ + memcpy(&mWAVBuffer[WAV_HEADER_SIZE], pcmout, (2 * fade_length)); /*Flawfinder: ignore*/ } S32 near_end = mWAVBuffer.size() - (2 * fade_length); - if (sizeof(mWAVBuffer) >= ( near_end + 2* fade_length)) + if ((S32)mWAVBuffer.size() >= ( near_end + 2* fade_length)) { memcpy(pcmout, &mWAVBuffer[near_end], (2 * fade_length)); /*Flawfinder: ignore*/ } @@ -562,7 +562,7 @@ BOOL LLVorbisDecodeState::finishDecode() } llendianswizzle(&pcmout, 2, fade_length); - if (near_end + (2 * fade_length) < sizeof(mWAVBuffer)) + if (near_end + (2 * fade_length) < (S32)mWAVBuffer.size()) { memcpy(&mWAVBuffer[near_end], pcmout, (2 * fade_length));/*Flawfinder: ignore*/ } |