diff options
| author | Aaron Brashears <aaronb@lindenlab.com> | 2007-02-02 17:28:58 +0000 |
|---|---|---|
| committer | Aaron Brashears <aaronb@lindenlab.com> | 2007-02-02 17:28:58 +0000 |
| commit | 305c74d5163c5e344a675d39ca2394a9e45bd2c2 (patch) | |
| tree | 42836c4a6010b2b015156024d3cfb6bf64a48ad6 /indra/llimage/llimagetga.cpp | |
| parent | 54d89549df38bb61881583a3eb8d3645c107d79f (diff) | |
Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release.
Diffstat (limited to 'indra/llimage/llimagetga.cpp')
| -rw-r--r-- | indra/llimage/llimagetga.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp index 1007f8e2bb..f19d85d754 100644 --- a/indra/llimage/llimagetga.cpp +++ b/indra/llimage/llimagetga.cpp @@ -183,7 +183,7 @@ BOOL LLImageTGA::updateData() // discard the ID field, if any if (mIDLength) { - memcpy(junk, getData()+mDataOffset, mIDLength); + memcpy(junk, getData()+mDataOffset, mIDLength); /* Flawfinder: ignore */ mDataOffset += mIDLength; } @@ -220,7 +220,12 @@ BOOL LLImageTGA::updateData() if ( (1 == mImageType) || (9 == mImageType) ) { mColorMap = new U8[ color_map_bytes ]; - memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); + if (!mColorMap) + { + llerrs << "Out of Memory in BOOL LLImageTGA::updateData()" << llendl; + return FALSE; + } + memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); /* Flawfinder: ignore */ } mDataOffset += color_map_bytes; @@ -432,7 +437,7 @@ BOOL LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, BOOL &alpha_opaqu } else if (getComponents() == 1) { - memcpy(dst, src, pixels); + memcpy(dst, src, pixels); /* Flawfinder: ignore */ } return TRUE; @@ -673,7 +678,7 @@ BOOL LLImageTGA::encode(const LLImageRaw* raw_image, F32 encode_time) switch( getComponents() ) { case 1: - memcpy( dst, src, bytes_per_pixel * pixels ); + memcpy( dst, src, bytes_per_pixel * pixels ); /* Flawfinder: ignore */ break; case 2: @@ -1053,7 +1058,7 @@ bool LLImageTGA::loadFile( const LLString& path ) return false; } - FILE *file = LLFile::fopen(path.c_str(), "rb"); + FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */ if( !file ) { llwarns << "Couldn't open file " << path << llendl; |
