diff options
Diffstat (limited to 'linden/indra/llimagej2coj/llimagej2coj.cpp')
-rw-r--r-- | linden/indra/llimagej2coj/llimagej2coj.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp index a0c61d8..ef498db 100644 --- a/linden/indra/llimagej2coj/llimagej2coj.cpp +++ b/linden/indra/llimagej2coj/llimagej2coj.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2006&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2006&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2006-2008, Linden Research, Inc. | 7 | * Copyright (c) 2006-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -183,6 +183,17 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod | |||
183 | return TRUE; | 183 | return TRUE; |
184 | } | 184 | } |
185 | 185 | ||
186 | if(image->numcomps <= first_channel) | ||
187 | { | ||
188 | llwarns << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl; | ||
189 | if (image) | ||
190 | { | ||
191 | opj_image_destroy(image); | ||
192 | } | ||
193 | |||
194 | return TRUE; | ||
195 | } | ||
196 | |||
186 | // Copy image data into our raw image format (instead of the separate channel format | 197 | // Copy image data into our raw image format (instead of the separate channel format |
187 | 198 | ||
188 | S32 img_components = image->numcomps; | 199 | S32 img_components = image->numcomps; |