diff options
| author | callum <none@none> | 2012-06-15 14:17:21 -0700 |
|---|---|---|
| committer | callum <none@none> | 2012-06-15 14:17:21 -0700 |
| commit | 0ff6275a654eda55662fab8d89d9ff4d278438d8 (patch) | |
| tree | cc9bee7b3aae707870405fa5ee58589c8d6161f3 /indra/llimage | |
| parent | 4985938269a91387e481731d469a0f1ca34e22a8 (diff) | |
| parent | a1d0d67e05c45bdc1a7a8bb0aad79772a2a94f6e (diff) | |
Merge with tip
Diffstat (limited to 'indra/llimage')
| -rw-r--r-- | indra/llimage/llimagepng.cpp | 12 |
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()); |
