Skip to content

Commit

Permalink
Add alignment check per CR.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoikas committed Mar 5, 2024
1 parent 4cefe42 commit 9aadb46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PrpShop/PRP/Surface/QMipmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ QMipmap::QMipmap(plCreatable* pCre, QWidget* parent)

static void swapColorChannels(unsigned char* data, size_t size)
{
Q_ASSERT(reinterpret_cast<uintptr_t>(data) % sizeof(unsigned int) == 0);

unsigned int* dp = reinterpret_cast<unsigned int*>(data);
for (size_t i=0; i<size; i += 4) {
*dp = (*dp & 0xFF00FF00)
Expand Down

0 comments on commit 9aadb46

Please sign in to comment.