From 4e6d2080ba2ad640ae3504f0a712477356cd0003 Mon Sep 17 00:00:00 2001 From: Anthoine Bourgeois Date: Tue, 18 Jun 2024 00:50:39 +0200 Subject: [PATCH] framework: fix swap between binary and logic not flags is a bit field. The logic not operator could have erased another bit than the one expected. --- framework/PVRCore/texture/TextureHeader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/PVRCore/texture/TextureHeader.h b/framework/PVRCore/texture/TextureHeader.h index 95543777f..489c625b8 100644 --- a/framework/PVRCore/texture/TextureHeader.h +++ b/framework/PVRCore/texture/TextureHeader.h @@ -308,7 +308,7 @@ struct TextureHeader if (isFileCompressed) { flags |= CompressedFlag; } else { - flags &= !static_cast(static_cast(CompressedFlag)); + flags &= ~static_cast(CompressedFlag); } } @@ -319,7 +319,7 @@ struct TextureHeader if (isPreMultiplied) { flags |= PremultipliedFlag; } else { - flags &= !static_cast(static_cast(PremultipliedFlag)); + flags &= ~static_cast(PremultipliedFlag); } }