vo_drm: fix potentially broken capability check

If the capability is available it may still be 0 to signal absence of support.
This commit is contained in:
sfan5 2019-12-06 16:28:03 +01:00
parent 823f52f91f
commit 376e57ee7b
1 changed files with 3 additions and 2 deletions

View File

@ -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;