diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index fd923703d..455cd48ff 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -99,7 +99,6 @@ void info_callback(const char* msg, void*) LLImageJ2COJ::LLImageJ2COJ() : LLImageJ2CImpl() { - mRawImagep=NULL; } @@ -350,7 +349,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con OPJ_COLOR_SPACE color_space = CLRSPC_SRGB; opj_image_cmptparm_t cmptparm[MAX_COMPS]; opj_image_t * image = NULL; - S32 numcomps = raw_image.getComponents(); + S32 numcomps = llmin((S32)raw_image.getComponents(),(S32)MAX_COMPS); S32 width = raw_image.getWidth(); S32 height = raw_image.getHeight(); diff --git a/indra/llimagej2coj/llimagej2coj.h b/indra/llimagej2coj/llimagej2coj.h index 73cb074f1..3995f6674 100644 --- a/indra/llimagej2coj/llimagej2coj.h +++ b/indra/llimagej2coj/llimagej2coj.h @@ -52,8 +52,6 @@ protected: return (a + (1 << b) - 1) >> b; } - // Temporary variables for in-progress decodes... - LLImageRaw *mRawImagep; }; #endif