From fcdfe91efa387dbcc01d5f18a4c711aaf5eb8d78 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 1 Jun 2021 14:02:46 +0200 Subject: [PATCH] frontend/dri: fix bool/int comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cast tex->bind & PIPE_BIND_PROTECTED to a bool before doing the comparison, otherwise it'll incorrectly fail. Reviewed-by: Marek Olšák Fixes: 18b7cafc700 ("driconf: add disable_protected_content_check option") Part-of: --- src/gallium/frontends/dri/dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index cb7d2478fe5..128b8f15a75 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -908,7 +908,7 @@ dri2_create_image_from_winsys(__DRIscreen *_screen, */ const struct driOptionCache *optionCache = &screen->dev->option_cache; if (!driQueryOptionb(optionCache, "disable_protected_content_check") && - (tex->bind & PIPE_BIND_PROTECTED) != is_protected_content) { + (bool)(tex->bind & PIPE_BIND_PROTECTED) != is_protected_content) { pipe_resource_reference(&img->texture, NULL); pipe_resource_reference(&tex, NULL); FREE(img);