frontend/dri: fix bool/int comparison

Cast tex->bind & PIPE_BIND_PROTECTED to a bool before doing the
comparison, otherwise it'll incorrectly fail.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 18b7cafc70 ("driconf: add disable_protected_content_check option")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11107>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-06-01 14:02:46 +02:00 committed by Marge Bot
parent 5e6f92f82c
commit fcdfe91efa
1 changed files with 1 additions and 1 deletions

View File

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