summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llimage')
-rw-r--r--[-rwxr-xr-x]indra/llimage/CMakeLists.txt0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimage.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimage.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagebmp.cpp14
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagebmp.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagedimensionsinfo.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagedimensionsinfo.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagedxt.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagedxt.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagefilter.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagefilter.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagej2c.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagej2c.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagejpeg.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagejpeg.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagepng.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagepng.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagetga.cpp6
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimagetga.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimageworker.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llimageworker.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llmapimagetype.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llpngwrapper.cpp0
-rw-r--r--[-rwxr-xr-x]indra/llimage/llpngwrapper.h0
-rw-r--r--[-rwxr-xr-x]indra/llimage/tests/llimageworker_test.cpp0
25 files changed, 20 insertions, 0 deletions
diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt
index 293ada7548..293ada7548 100755..100644
--- a/indra/llimage/CMakeLists.txt
+++ b/indra/llimage/CMakeLists.txt
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 08462c7834..08462c7834 100755..100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index cd3f76f1fd..cd3f76f1fd 100755..100644
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp
index 8573fe0d91..a2ce2fee86 100755..100644
--- a/indra/llimage/llimagebmp.cpp
+++ b/indra/llimage/llimagebmp.cpp
@@ -443,6 +443,10 @@ BOOL LLImageBMP::decodeColorMask32( U8* dst, U8* src )
mBitfieldMask[2] = 0x000000FF;
}
+ if (getWidth() * getHeight() * 4 > getDataSize() - mBitmapOffset)
+ { //here we have situation when data size in src less than actually needed
+ return FALSE;
+ }
S32 src_row_span = getWidth() * 4;
S32 alignment_bytes = (3 * src_row_span) % 4; // round up to nearest multiple of 4
@@ -476,6 +480,11 @@ BOOL LLImageBMP::decodeColorTable8( U8* dst, U8* src )
S32 src_row_span = getWidth() * 1;
S32 alignment_bytes = (3 * src_row_span) % 4; // round up to nearest multiple of 4
+ if ((getWidth() * getHeight()) + getHeight() * alignment_bytes > getDataSize() - mBitmapOffset)
+ { //here we have situation when data size in src less than actually needed
+ return FALSE;
+ }
+
for( S32 row = 0; row < getHeight(); row++ )
{
for( S32 col = 0; col < getWidth(); col++ )
@@ -501,6 +510,11 @@ BOOL LLImageBMP::decodeTruecolor24( U8* dst, U8* src )
S32 src_row_span = getWidth() * 3;
S32 alignment_bytes = (3 * src_row_span) % 4; // round up to nearest multiple of 4
+ if ((getWidth() * getHeight() * 3) + getHeight() * alignment_bytes > getDataSize() - mBitmapOffset)
+ { //here we have situation when data size in src less than actually needed
+ return FALSE;
+ }
+
for( S32 row = 0; row < getHeight(); row++ )
{
for( S32 col = 0; col < getWidth(); col++ )
diff --git a/indra/llimage/llimagebmp.h b/indra/llimage/llimagebmp.h
index db0b45def0..db0b45def0 100755..100644
--- a/indra/llimage/llimagebmp.h
+++ b/indra/llimage/llimagebmp.h
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp
index 5bf3f29b3c..5bf3f29b3c 100755..100644
--- a/indra/llimage/llimagedimensionsinfo.cpp
+++ b/indra/llimage/llimagedimensionsinfo.cpp
diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h
index 8f716c5d02..8f716c5d02 100755..100644
--- a/indra/llimage/llimagedimensionsinfo.h
+++ b/indra/llimage/llimagedimensionsinfo.h
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index 04e0e752eb..04e0e752eb 100755..100644
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
diff --git a/indra/llimage/llimagedxt.h b/indra/llimage/llimagedxt.h
index a8756ba8ed..a8756ba8ed 100755..100644
--- a/indra/llimage/llimagedxt.h
+++ b/indra/llimage/llimagedxt.h
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 41adc7be9a..41adc7be9a 100755..100644
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
diff --git a/indra/llimage/llimagefilter.h b/indra/llimage/llimagefilter.h
index 16ec395f76..16ec395f76 100755..100644
--- a/indra/llimage/llimagefilter.h
+++ b/indra/llimage/llimagefilter.h
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index 7cd59a2983..7cd59a2983 100755..100644
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h
index ce8195940d..ce8195940d 100755..100644
--- a/indra/llimage/llimagej2c.h
+++ b/indra/llimage/llimagej2c.h
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index e419c77ff2..e419c77ff2 100755..100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h
index 2142660c81..2142660c81 100755..100644
--- a/indra/llimage/llimagejpeg.h
+++ b/indra/llimage/llimagejpeg.h
diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp
index 7735dc1379..7735dc1379 100755..100644
--- a/indra/llimage/llimagepng.cpp
+++ b/indra/llimage/llimagepng.cpp
diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h
index 1fbd850a2e..1fbd850a2e 100755..100644
--- a/indra/llimage/llimagepng.h
+++ b/indra/llimage/llimagepng.h
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 4eb8dc7440..d0ae105ba7 100755..100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -437,7 +437,13 @@ BOOL LLImageTGA::decodeTruecolorNonRle( LLImageRaw* raw_image, BOOL &alpha_opaqu
// Origin is the bottom left
U8* dst = raw_image->getData();
U8* src = getData() + mDataOffset;
+
S32 pixels = getWidth() * getHeight();
+
+ if (pixels * (mIs15Bit ? 2 : getComponents()) > getDataSize() - mDataOffset)
+ { //here we have situation when data size in src less than actually needed
+ return FALSE;
+ }
if (getComponents() == 4)
{
diff --git a/indra/llimage/llimagetga.h b/indra/llimage/llimagetga.h
index 5da3525149..5da3525149 100755..100644
--- a/indra/llimage/llimagetga.h
+++ b/indra/llimage/llimagetga.h
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index 4875fe7001..4875fe7001 100755..100644
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h
index 1bfb0ddfd3..1bfb0ddfd3 100755..100644
--- a/indra/llimage/llimageworker.h
+++ b/indra/llimage/llimageworker.h
diff --git a/indra/llimage/llmapimagetype.h b/indra/llimage/llmapimagetype.h
index 0a040d3db9..0a040d3db9 100755..100644
--- a/indra/llimage/llmapimagetype.h
+++ b/indra/llimage/llmapimagetype.h
diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp
index aad139f570..aad139f570 100755..100644
--- a/indra/llimage/llpngwrapper.cpp
+++ b/indra/llimage/llpngwrapper.cpp
diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h
index 27d7df3bef..27d7df3bef 100755..100644
--- a/indra/llimage/llpngwrapper.h
+++ b/indra/llimage/llpngwrapper.h
diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp
index 51c5c63556..51c5c63556 100755..100644
--- a/indra/llimage/tests/llimageworker_test.cpp
+++ b/indra/llimage/tests/llimageworker_test.cpp