Skip to content

Commit

Permalink
fix: Overflow on Android when overflow check is off. Related to: #123
Browse files Browse the repository at this point in the history
  • Loading branch information
E Spelt committed Nov 18, 2022
1 parent 38d1abe commit 9a0e811
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/Classes/Common/ZXing.Common.BitArrayImplementation.pas
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ function TBitArrayImplementation.getNextUnset(from: Integer): Integer;
currentBits := not Fbits[bitsOffset];

// mask off lesser bits first
currentBits := currentBits and (not( (1 shl (from and $1F)) - 1));
{$OVERFLOWCHECKS OFF}
currentBits := currentBits and -(1 shl (from and $1F));
{$OVERFLOWCHECKS ON}

while (currentBits = 0) do
begin
Inc(bitsOffset);
Expand Down

0 comments on commit 9a0e811

Please sign in to comment.