mirror of https://github.com/GNOME/gimp.git
plug-ins: Fix crash when loading CMYK JPEG 2000 images
When converting a CMYK JPEG 2000 image to RGB, we freed the Key array. Since it is still in use, this caused the plug-in to crash. This patch replaces this with lowering the component content and letting the OpenJPEG clean up process handle this work instead.
This commit is contained in:
parent
535d0183be
commit
127cd67118
|
@ -797,8 +797,6 @@ color_cmyk_to_rgb (opj_image_t *image)
|
|||
image->comps[2].data[i] = (int) (255.0f * Y * K); /* B */
|
||||
}
|
||||
|
||||
free (image->comps[3].data);
|
||||
image->comps[3].data = NULL;
|
||||
image->comps[0].prec = 8;
|
||||
image->comps[1].prec = 8;
|
||||
image->comps[2].prec = 8;
|
||||
|
@ -811,6 +809,10 @@ color_cmyk_to_rgb (opj_image_t *image)
|
|||
sizeof (image->comps[i]));
|
||||
}
|
||||
|
||||
/* Restore the count so the OpenJPEG destroy function works
|
||||
* properly */
|
||||
image->numcomps += 1;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1212,6 +1214,8 @@ load_image (GimpProcedure *procedure,
|
|||
gimp_file_get_utf8_name (file));
|
||||
goto out;
|
||||
}
|
||||
|
||||
num_components--;
|
||||
}
|
||||
else if (image->color_space == OPJ_CLRSPC_EYCC)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue