Ignore:
Timestamp:
Nov 8, 2011, 6:44:59 AM (13 years ago)
Author:
george
Message:
  • Fixed: Filtering unused bits in reading operation of TBitStream.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CoolStreaming/UBitStream.pas

    r291 r292  
    262262        TBytes(Buffer)[I] := TBytes(Buffer)[I] or
    263263          ((Integer(Data) and ((1 shl PosInByte) - 1)) shl (8 - PosInByte));
    264       if (I = (ByteCount - 1)) and (PosInByte > 0) then
    265         TBytes(Buffer)[I] := TBytes(Buffer)[I] and ((1 shl (Count mod 8)) - 1);
     264      if (I = (ByteCount - 1)) then
     265        TBytes(Buffer)[I] := TBytes(Buffer)[I] and ((1 shl (Count - 8 * (ByteCount - 1))) - 1);
    266266    end;
    267267    Inc(FPosition, Count);
Note: See TracChangeset for help on using the changeset viewer.