mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
output: Validate EDID information as UTF-8 only if it exists
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3021 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3268>
This commit is contained in:
parent
4514d29c90
commit
c96341dcd5
@ -330,7 +330,8 @@ set_output_details_from_edid (MetaOutputInfo *output_info,
|
|||||||
g_clear_pointer (&output_info->vendor, g_free);
|
g_clear_pointer (&output_info->vendor, g_free);
|
||||||
|
|
||||||
output_info->product = g_strdup (edid_info->dsc_product_name);
|
output_info->product = g_strdup (edid_info->dsc_product_name);
|
||||||
if (!g_utf8_validate (output_info->product, -1, NULL) ||
|
if (!output_info->product ||
|
||||||
|
!g_utf8_validate (output_info->product, -1, NULL) ||
|
||||||
output_info->product[0] == '\0')
|
output_info->product[0] == '\0')
|
||||||
{
|
{
|
||||||
g_clear_pointer (&output_info->product, g_free);
|
g_clear_pointer (&output_info->product, g_free);
|
||||||
@ -339,7 +340,8 @@ set_output_details_from_edid (MetaOutputInfo *output_info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
output_info->serial = g_strdup (edid_info->dsc_serial_number);
|
output_info->serial = g_strdup (edid_info->dsc_serial_number);
|
||||||
if (!g_utf8_validate (output_info->serial, -1, NULL) ||
|
if (!output_info->serial ||
|
||||||
|
!g_utf8_validate (output_info->serial, -1, NULL) ||
|
||||||
output_info->serial[0] == '\0')
|
output_info->serial[0] == '\0')
|
||||||
{
|
{
|
||||||
g_clear_pointer (&output_info->serial, g_free);
|
g_clear_pointer (&output_info->serial, g_free);
|
||||||
|
Loading…
Reference in New Issue
Block a user