Make Encoder:get_crtc() return 0 if no crtc
[android/external-libkmsxx.git] / libkms++ / encoder.cpp
index 081177b351c0b3be6d787ec199fae9dd7b2f9c3f..81eba719ff46d45772c74e96333f5fe287bc9b2c 100644 (file)
@@ -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