File openjpeg2-CVE-2018-21010.patch of Package openjpeg2.36921
Index: openjpeg-2.1.0/src/bin/common/color.c
===================================================================
--- openjpeg-2.1.0.orig/src/bin/common/color.c
+++ openjpeg-2.1.0/src/bin/common/color.c
@@ -472,6 +472,10 @@ fprintf(stderr,"%s:%d:color_apply_icc_pr
if(image->numcomps > 2)/* RGB, RGBA */
{
+ if ((image->comps[0].w == image->comps[1].w &&
+ image->comps[0].w == image->comps[2].w) &&
+ (image->comps[0].h == image->comps[1].h &&
+ image->comps[0].h == image->comps[2].h)) {
if( prec <= 8 )
{
unsigned char *inbuf, *outbuf, *in, *out;
@@ -538,6 +542,12 @@ else
}
free(inbuf); free(outbuf);
}
+ } else {
+ fprintf(stderr,
+ "[ERROR] Image components should have the same width and height\n");
+ cmsDeleteTransform(transform);
+ return;
+ }
}
else /* GRAY, GRAYA */
{