summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-07-05 13:07:09 -0400
committerAdam Jackson <ajax@redhat.com>2016-09-28 14:53:39 -0400
commitd51cce7992508f366758fa13dd93be24df0947ed (patch)
tree815bb1408bcf2274aabd833282279391d0763df9 /hw/kdrive
parent445271ec00f25405fa5ed0e149dd4a9d9f6098d4 (diff)
xephyr: Don't crash if the server advertises zero xv adaptors
Useless as an XVideo implementation with zero adaptors might be, it's apparently a thing in the wild. Catch this case and bail out of xv init if it happens. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/ephyr/ephyrvideo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c
index 56a5ff1f8..31b1eee31 100644
--- a/hw/kdrive/ephyr/ephyrvideo.c
+++ b/hw/kdrive/ephyr/ephyrvideo.c
@@ -462,7 +462,7 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this)
if (a_this->host_adaptors)
a_this->num_adaptors = a_this->host_adaptors->num_adaptors;
- if (a_this->num_adaptors < 0) {
+ if (a_this->num_adaptors <= 0) {
EPHYR_LOG_ERROR("failed to get number of host adaptors\n");
goto out;
}