[Mesa-dev] [PATCH 03/10] gbm: don't deference validateUsage when it's NULL

Emil Velikov emil.l.velikov at gmail.com
Mon Oct 16 16:04:05 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

The entry-point can be NULL, even if the version advertised is >= 2.

Fixes: 221c678329f ("gbm: Validate usage flags in gbm_bo_create_from_egl_image()")
Cc: Kristian Høgsberg <krh at bitplanet.net>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/gbm/backends/dri/gbm_dri.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 35298751237..4a51bd39903 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -1031,6 +1031,7 @@ gbm_dri_bo_import(struct gbm_device *gbm,
    if (usage & GBM_BO_USE_CURSOR)
       dri_use |= __DRI_IMAGE_USE_CURSOR;
    if (dri->image->base.version >= 2 &&
+       dri->image->validateUsage &&
        !dri->image->validateUsage(bo->image, dri_use)) {
       errno = EINVAL;
       dri->image->destroyImage(bo->image);
-- 
2.14.1



More information about the mesa-dev mailing list