summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-06-04 15:28:08 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-06-04 15:28:08 -0400
commit6ee04562208100fc164bd3818ab3ba73f060d90c (patch)
tree27b544b1832a9f3d88b39bc66a5e676d5aba511b /indra/llimage
parent8dae8290b7be728d0c70205b1f27b08f899c9d32 (diff)
parenta519e34f02b4b2663fe082ba9ad12f1b423669cb (diff)
merge
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagepng.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp
index 8d493ecde0..294f68b122 100644
--- a/indra/llimage/llimagepng.cpp
+++ b/indra/llimage/llimagepng.cpp
@@ -60,6 +60,12 @@ BOOL LLImagePNG::updateData()
// Decode the PNG data and extract sizing information
LLPngWrapper pngWrapper;
+ if (!pngWrapper.isValidPng(getData()))
+ {
+ setLastError("LLImagePNG data does not have a valid PNG header!");
+ return FALSE;
+ }
+
LLPngWrapper::ImageInfo infop;
if (! pngWrapper.readPng(getData(), NULL, &infop))
{
@@ -90,6 +96,12 @@ BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time)
// Decode the PNG data into the raw image
LLPngWrapper pngWrapper;
+ if (!pngWrapper.isValidPng(getData()))
+ {
+ setLastError("LLImagePNG data does not have a valid PNG header!");
+ return FALSE;
+ }
+
if (! pngWrapper.readPng(getData(), raw_image))
{
setLastError(pngWrapper.getErrorMessage());