From 9c8a578e214a43d632d97aad77d6289bea94b030 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 15 Apr 2021 20:42:11 +0200 Subject: [PATCH] v4l2: don't select DmaBuf when the type mask is invalid an invalid data type mask means that the caller did not explicitly allowed DmaBuf so fall back to memptr or memfd. Fixes #1054 --- spa/plugins/v4l2/v4l2-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index d3b7a15be..e11a0e998 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1457,7 +1457,9 @@ mmap_init(struct impl *this, spa_log_debug(this->log, "v4l2: data types %08x", d[0].type); - if (port->have_expbuf && (d[0].type & (1u << SPA_DATA_DmaBuf))) { + if (port->have_expbuf && + d[0].type != SPA_ID_INVALID && + (d[0].type & (1u << SPA_DATA_DmaBuf))) { struct v4l2_exportbuffer expbuf; spa_zero(expbuf);