Skip to content
Commit c1133d2f authored by Simon McVittie's avatar Simon McVittie Committed by Jonas Ådahl
Browse files

color-device: Don't close lcms profile on error from cd_icc_load_handle

As implemented in colord 1.4.6, cd_icc_load_handle() has three possible
results:

1. success, taking ownership of the profile;
2. failure because cmsGetProfileContextID returns NULL, *not* taking
   ownership of the profile;
3. failure in cd_icc_load(), taking ownership of the profile.

The previous commit ensures that we are not in case 2.

In case 3 where cd_icc_load() fails, ownership was already given to
the colord CdIcc object, so it will be freed when the g_autoptr unrefs
the CdIcc, and we must not free it again: that would be a double-free,
potentially resulting in memory corruption.

Resolves: https://gitlab.gnome.org/GNOME/mutter/-/issues/2659


Signed-off-by: default avatarSimon McVittie <smcv@debian.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2877>


(cherry picked from commit ed12df10)
parent c418c449
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment