summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagejpeg.cpp
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
commit305c74d5163c5e344a675d39ca2394a9e45bd2c2 (patch)
tree42836c4a6010b2b015156024d3cfb6bf64a48ad6 /indra/llimage/llimagejpeg.cpp
parent54d89549df38bb61881583a3eb8d3645c107d79f (diff)
Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release.
Diffstat (limited to 'indra/llimage/llimagejpeg.cpp')
-rw-r--r--indra/llimage/llimagejpeg.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index c75e449db5..b1ab279de7 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -335,7 +335,12 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )
// Double the buffer size;
S32 new_buffer_size = self->mOutputBufferSize * 2;
U8* new_buffer = new U8[ new_buffer_size ];
- memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize );
+ if (!new_buffer)
+ {
+ llerrs << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << llendl;
+ return FALSE;
+ }
+ memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */
delete[] self->mOutputBuffer;
self->mOutputBuffer = new_buffer;
@@ -359,7 +364,7 @@ void LLImageJPEG::encodeTermDestination( j_compress_ptr cinfo )
S32 file_bytes = (S32)(self->mOutputBufferSize - cinfo->dest->free_in_buffer);
self->allocateData(file_bytes);
- memcpy( self->getData(), self->mOutputBuffer, file_bytes );
+ memcpy( self->getData(), self->mOutputBuffer, file_bytes ); /* Flawfinder: ignore */
}
// static
@@ -416,7 +421,7 @@ void LLImageJPEG::errorEmitMessage( j_common_ptr cinfo, int msg_level )
void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo )
{
// Create the message
- char buffer[JMSG_LENGTH_MAX];
+ char buffer[JMSG_LENGTH_MAX]; /* Flawfinder: ignore */
(*cinfo->err->format_message) (cinfo, buffer);
((LLImageJPEG*) cinfo->client_data)->setLastError( buffer );