Fix KoColorProfile::linearize/delinearize result vector resize
Sometimes it is convenient to pass the result vector with more than a 3 elements, e.g. when passing QVector(4) with RGBA values. In this case old implementation resized vector to 3 values. This patch fixes assertion failure in KoColorSpace::decreaseLuminosity: out-of-bounds access to channelValues vector It occurs because we store the number of channels before linearize/delinearize and then iterate over the channelValues assuming that its size was not changed. With this patch, Alpha channel is ignored during linearization and vector size does not change. Patch by Andrew Savonichev <firstname.lastname@example.org>(asavonic) Thanks!
Showing with 13 additions and 7 deletions