diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 3f1171667..352a1822d 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1230,6 +1230,9 @@ meta_output_parse_edid (MetaOutput *meta_output, MonitorInfo *parsed_edid; gsize len; + if (!edid) + goto out; + parsed_edid = decode_edid (g_bytes_get_data (edid, &len)); if (parsed_edid) @@ -1247,6 +1250,7 @@ meta_output_parse_edid (MetaOutput *meta_output, g_free (parsed_edid); } + out: if (!meta_output->vendor) { meta_output->vendor = g_strdup ("unknown"); diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c index 13709f165..9efba75f2 100644 --- a/src/backends/native/meta-monitor-manager-kms.c +++ b/src/backends/native/meta-monitor-manager-kms.c @@ -512,11 +512,8 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager) find_properties (manager_kms, output_kms); edid = read_output_edid (manager_kms, meta_output); - if (edid) - { - meta_output_parse_edid (meta_output, edid); - g_bytes_unref (edid); - } + meta_output_parse_edid (meta_output, edid); + g_bytes_unref (edid); /* MetaConnectorType matches DRM's connector types */ meta_output->connector_type = (MetaConnectorType) connector->connector_type; diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 03b4152fc..d9505926a 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -693,11 +693,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager) meta_output->name = g_strdup (output->name); edid = read_output_edid (manager_xrandr, meta_output->winsys_id); - if (edid) - { - meta_output_parse_edid (meta_output, edid); - g_bytes_unref (edid); - } + meta_output_parse_edid (meta_output, edid); + g_bytes_unref (edid); meta_output->width_mm = output->mm_width; meta_output->height_mm = output->mm_height;