color-device: Don't wrongly use Unknown vendor in ICC profile from EDID

If the vendor_name was previously successfully determined, we would end
up in the else case, overwriting it with "Unknown vendor" and leaking
the previous vendor_name.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2603>
This commit is contained in:
Sebastian Keller 2022-09-01 19:52:21 +02:00 committed by Marge Bot
parent 9aa9cacb3d
commit 57c7d75c43

View File

@ -877,10 +877,13 @@ create_icc_profile_from_edid (MetaColorDevice *color_device,
cd_icc_set_description (cd_icc, NULL,
meta_monitor_get_display_name (monitor));
if (!vendor_name && vendor)
vendor_name = g_strdup (vendor);
else
vendor_name = g_strdup ("Unknown vendor");
if (!vendor_name)
{
if (vendor)
vendor_name = g_strdup (vendor);
else
vendor_name = g_strdup ("Unknown vendor");
}
cd_icc_set_manufacturer (cd_icc, NULL, vendor_name);
/* Set the framework creator metadata */