summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@iki.fi>2015-09-30 21:50:14 +0300
committerTomi Valkeinen <tomi.valkeinen@iki.fi>2015-10-01 19:40:22 +0300
commit9820f004f2be68cdf680f16b6ef341ed318c4870 (patch)
tree0227efa054123e22a2750d23bbc6b2a46667c2ef
parent50182e47bdcca178e91778e508a512aa2e2ea4cf (diff)
Make Encoder:get_crtc() return 0 if no crtc
-rw-r--r--libkms++/encoder.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libkms++/encoder.cpp b/libkms++/encoder.cpp
index 081177b..81eba71 100644
--- a/libkms++/encoder.cpp
+++ b/libkms++/encoder.cpp
@@ -42,7 +42,10 @@ void Encoder::print_short() const
Crtc* Encoder::get_crtc() const
{
- return card().get_crtc(m_priv->drm_encoder->crtc_id);
+ if (m_priv->drm_encoder->crtc_id)
+ return card().get_crtc(m_priv->drm_encoder->crtc_id);
+ else
+ return 0;
}
vector<Crtc*> Encoder::get_possible_crtcs() const