Skip to content

Commit

Permalink
framework: fix swap between binary and logic not
Browse files Browse the repository at this point in the history
flags is a bit field. The logic not operator could have erased another
bit than the one expected.
  • Loading branch information
Alucowie committed Jul 5, 2024
1 parent 6e7a32d commit 193b832
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/PVRCore/texture/TextureHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ struct TextureHeader
if (isFileCompressed) { flags |= CompressedFlag; }
else
{
flags &= !static_cast<bool>(static_cast<uint32_t>(CompressedFlag));
flags &= ~static_cast<uint32_t>(CompressedFlag);
}
}

Expand All @@ -319,7 +319,7 @@ struct TextureHeader
if (isPreMultiplied) { flags |= PremultipliedFlag; }
else
{
flags &= !static_cast<bool>(static_cast<uint32_t>(PremultipliedFlag));
flags &= ~static_cast<uint32_t>(PremultipliedFlag);
}
}

Expand Down

0 comments on commit 193b832

Please sign in to comment.