summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2019-12-06 16:28:03 +0100
committersfan5 <sfan5@live.de>2019-12-07 16:44:27 +0100
commit376e57ee7b8223a77a4c63dc1198bf1a875b4a31 (patch)
treed1c897af4d48ae0fb759cde55dd9017b9ef6c5cc
parent823f52f91fbe2cac771373e966402515a312ab82 (diff)
downloadmpv-376e57ee7b8223a77a4c63dc1198bf1a875b4a31.tar.bz2
mpv-376e57ee7b8223a77a4c63dc1198bf1a875b4a31.tar.xz
vo_drm: fix potentially broken capability check
If the capability is available it may still be 0 to signal absence of support.
-rw-r--r--video/out/vo_drm.c5
1 files 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;