diff options
-rw-r--r-- | drm/drmconnector.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drm/drmconnector.cpp b/drm/drmconnector.cpp index 2c0adda..7cde7cd 100644 --- a/drm/drmconnector.cpp +++ b/drm/drmconnector.cpp @@ -124,9 +124,14 @@ std::string DrmConnector::name() const { "SVIDEO", "LVDS", "Component", "DIN", "DP", "HDMI-A", "HDMI-B", "TV", "eDP", "Virtual", "DSI"}; - std::ostringstream name_buf; - name_buf << names[type_] << "-" << type_id_; - return name_buf.str(); + if (type_ < TYPES_COUNT) { + std::ostringstream name_buf; + name_buf << names[type_] << "-" << type_id_; + return name_buf.str(); + } else { + ALOGE("Unknown type in connector %d, could not make his name", id_); + return "None"; + } } int DrmConnector::UpdateModes() { |