diff options
author | Oz Linden <oz@lindenlab.com> | 2012-04-20 06:56:33 -0700 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-04-20 06:56:33 -0700 |
commit | d3ec35fc6c2b8b47336650fe0570995201854a78 (patch) | |
tree | f2113a1fa374fab76509f4462b2253b315584f65 /indra/llimage | |
parent | 4c3377a45abe3c8b2a0e376c62045a8f1260da08 (diff) | |
parent | 19e0cc93a8af661dbac47552474a704ade600c74 (diff) |
merge changes for latest viewer-development
Diffstat (limited to 'indra/llimage')
-rw-r--r-- | indra/llimage/llimagej2c.cpp | 8 | ||||
-rw-r--r-- | indra/llimage/llimagepng.cpp | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index cc8cb66d73..8241746a74 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -501,10 +501,10 @@ void LLImageCompressionTester::outputTestRecord(LLSD *sd) F32 decompressionRate = 0.0f; F32 compressionRate = 0.0f; - F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.0; - F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.0; - F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.0; - F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.0; + F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.f; + F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.f; + F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.f; + F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.f; if (!is_approx_zero(mTotalTimeDecompression)) { 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()); |