Skip to content

Commit

Permalink
Attempt to fix #14022
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 30, 2021
1 parent c251d69 commit 58f1905
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Core/Font/PGF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ static int getBits(int numBits, const u8 *buf, size_t pos) {

const u8 done = 32 - bitoff;
const u8 remaining = numBits - done;
const u32 mask = (1 << remaining) - 1;
v |= (wordbuf[wordpos + 1] & mask) << done;
if (remaining > 0) {
const u32 mask = (1 << remaining) - 1;
v |= (wordbuf[wordpos + 1] & mask) << done;
}
return v;
}
}
Expand Down

0 comments on commit 58f1905

Please sign in to comment.