mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-05 11:12:42 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user