From 376e57ee7b8223a77a4c63dc1198bf1a875b4a31 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 6 Dec 2019 16:28:03 +0100 Subject: vo_drm: fix potentially broken capability check If the capability is available it may still be 0 to signal absence of support. --- video/out/vo_drm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c index 61722213ad..be5b0c52d9 100644 --- a/video/out/vo_drm.c +++ b/video/out/vo_drm.c @@ -590,8 +590,9 @@ static int preinit(struct vo *vo) goto err; } - uint64_t has_dumb; - if (drmGetCap(p->kms->fd, DRM_CAP_DUMB_BUFFER, &has_dumb) < 0) { + uint64_t has_dumb = 0; + if (drmGetCap(p->kms->fd, DRM_CAP_DUMB_BUFFER, &has_dumb) < 0 + || has_dumb == 0) { MP_ERR(vo, "Card \"%d\" does not support dumb buffers.\n", p->kms->card_no); goto err; -- cgit v1.2.3