diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llimage/llimagejpeg.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llimage/llimagejpeg.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/linden/indra/llimage/llimagejpeg.cpp b/linden/indra/llimage/llimagejpeg.cpp index 5c83f20..fdfcc16 100644 --- a/linden/indra/llimage/llimagejpeg.cpp +++ b/linden/indra/llimage/llimagejpeg.cpp | |||
@@ -354,7 +354,12 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo ) | |||
354 | // Double the buffer size; | 354 | // Double the buffer size; |
355 | S32 new_buffer_size = self->mOutputBufferSize * 2; | 355 | S32 new_buffer_size = self->mOutputBufferSize * 2; |
356 | U8* new_buffer = new U8[ new_buffer_size ]; | 356 | U8* new_buffer = new U8[ new_buffer_size ]; |
357 | memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); | 357 | if (!new_buffer) |
358 | { | ||
359 | llerrs << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << llendl; | ||
360 | return FALSE; | ||
361 | } | ||
362 | memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */ | ||
358 | delete[] self->mOutputBuffer; | 363 | delete[] self->mOutputBuffer; |
359 | self->mOutputBuffer = new_buffer; | 364 | self->mOutputBuffer = new_buffer; |
360 | 365 | ||
@@ -378,7 +383,7 @@ void LLImageJPEG::encodeTermDestination( j_compress_ptr cinfo ) | |||
378 | S32 file_bytes = (S32)(self->mOutputBufferSize - cinfo->dest->free_in_buffer); | 383 | S32 file_bytes = (S32)(self->mOutputBufferSize - cinfo->dest->free_in_buffer); |
379 | self->allocateData(file_bytes); | 384 | self->allocateData(file_bytes); |
380 | 385 | ||
381 | memcpy( self->getData(), self->mOutputBuffer, file_bytes ); | 386 | memcpy( self->getData(), self->mOutputBuffer, file_bytes ); /* Flawfinder: ignore */ |
382 | } | 387 | } |
383 | 388 | ||
384 | // static | 389 | // static |
@@ -435,7 +440,7 @@ void LLImageJPEG::errorEmitMessage( j_common_ptr cinfo, int msg_level ) | |||
435 | void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo ) | 440 | void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo ) |
436 | { | 441 | { |
437 | // Create the message | 442 | // Create the message |
438 | char buffer[JMSG_LENGTH_MAX]; | 443 | char buffer[JMSG_LENGTH_MAX]; /* Flawfinder: ignore */ |
439 | (*cinfo->err->format_message) (cinfo, buffer); | 444 | (*cinfo->err->format_message) (cinfo, buffer); |
440 | 445 | ||
441 | ((LLImageJPEG*) cinfo->client_data)->setLastError( buffer ); | 446 | ((LLImageJPEG*) cinfo->client_data)->setLastError( buffer ); |