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
This commit is contained in:
Wim Taymans 2021-04-15 20:42:11 +02:00
parent cd79cdfb40
commit 9c8a578e21

View file

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