From 48b429e7b1e35588f41f45530dfe340ca0521ace Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 15 May 2020 14:55:32 +0200 Subject: [PATCH] Add n_planes == 1 assert in drm_fbid_from_dmabuf This code assumes a single planes. Let's add a safe-guard so that we don't forget this function when adding support for multiple planes. --- src/drm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drm.cpp b/src/drm.cpp index 4538d94..53fa95d 100644 --- a/src/drm.cpp +++ b/src/drm.cpp @@ -627,6 +627,8 @@ out: uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_dmabuf_attributes *dma_buf ) { + assert( dma_buf->n_planes == 1); + uint32_t ret = 0; uint32_t handles[4] = { 0 }; drmPrimeFDToHandle( drm->fd, dma_buf->fd[0], &handles[0] );