Browse Source

fpreadtif: fixed read LZW stream at end of a bit length increase, bug #22724

git-svn-id: trunk@28287 -
Mattias Gaertner 11 years ago
parent
commit
0d4fa26c51
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/fcl-image/src/fpreadtiff.pas

+ 2 - 0
packages/fcl-image/src/fpreadtiff.pas

@@ -2256,6 +2256,8 @@ var
     p[s1.Count]:=s2.Data^;
     // increase TableCount
     inc(TableCount);
+    if ((SrcPos+3=Count) and (CurBitLength+SrcPosBit>16)) or
+       ((SrcPos+2=Count) and (CurBitLength+SrcPosBit<=16)) then exit;
     case TableCount+259 of
     512,1024,2048: inc(CurBitLength);
     end;