diff options
| author | Oz Linden <oz@lindenlab.com> | 2012-04-17 13:47:31 -0700 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2012-04-17 13:47:31 -0700 |
| commit | 19e0cc93a8af661dbac47552474a704ade600c74 (patch) | |
| tree | 5d7e539a4c98607a189c6e472732b75608379abb /indra/llimage | |
| parent | ee1124e1c02b1a8be0cc8d2cbce1083dca3b40a2 (diff) | |
| parent | 3ccda1f2855ae9e5b3f519236e9b4f233d542d1a (diff) | |
DRTVWR-139: merge back 3.3.1-beta2 fixes
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()); |
