forked from mia/Aegisub
Fix undefined behavior in DataBlockCache::SetBlockCount()
Left-shifting negative signed numbers is UB (and pointlessly complex here anyway).
This commit is contained in:
parent
652a250189
commit
4542204b3a
1 changed files with 2 additions and 3 deletions
|
@ -119,9 +119,8 @@ public:
|
|||
if (data.size() > 0)
|
||||
Age(0);
|
||||
|
||||
macroblock_size = 1 << MacroblockExponent;
|
||||
|
||||
macroblock_index_mask = ~(((~0) >> MacroblockExponent) << MacroblockExponent);
|
||||
macroblock_size = 1UL << MacroblockExponent;
|
||||
macroblock_index_mask = macroblock_size - 1;
|
||||
|
||||
data.resize((block_count + macroblock_size - 1) >> MacroblockExponent);
|
||||
size = 0;
|
||||
|
|
Loading…
Reference in a new issue