summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-01-12 14:53:04 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-01-12 14:53:04 +0200
commit7a5b08df7826a0c5070bc473eb51854e853c7220 (patch)
tree9c867de692acfa01f722afbf6d95d41af4efc37b /libkms++
parentf046348793516165ea8cf923faa27f1e0455c3c5 (diff)
libkms: fix Connector::get_default_mode when no modes
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/connector.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libkms++/connector.cpp b/libkms++/connector.cpp
index 325b610..e108410 100644
--- a/libkms++/connector.cpp
+++ b/libkms++/connector.cpp
@@ -96,6 +96,8 @@ void Connector::restore_mode()
Videomode Connector::get_default_mode() const
{
+ if (m_priv->drm_connector->count_modes == 0)
+ throw invalid_argument("no modes available\n");
drmModeModeInfo drmmode = m_priv->drm_connector->modes[0];
return drm_mode_to_video_mode(drmmode);