diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 8f78d43ae..93790b591 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -330,7 +330,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 = min(raw_image.getComponents(),MAX_COMPS); //Clamp avoid overrunning buffer -Shyotl + S32 numcomps = raw_image.getComponents() > MAX_COMPS ? MAX_COMPS : raw_image.getComponents(); //Clamp avoid overrunning buffer -Shyotl S32 width = raw_image.getWidth(); S32 height = raw_image.getHeight();