mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-28 13:47:21 +01:00
fpreadtiff: fixed checking for code 4096 before add instead of after last add, bug #22558
git-svn-id: trunk@22238 -
This commit is contained in:
parent
d327960994
commit
be41f296a0
@ -2181,6 +2181,8 @@ var
|
|||||||
p: PByte;
|
p: PByte;
|
||||||
begin
|
begin
|
||||||
//WriteLn('AddStringToTable Code=',Code,' FCFCode=',AddFirstCharFromCode,' TableCount=',TableCount,' TableCapacity=',TableCapacity);
|
//WriteLn('AddStringToTable Code=',Code,' FCFCode=',AddFirstCharFromCode,' TableCount=',TableCount,' TableCapacity=',TableCapacity);
|
||||||
|
if TableCount=4096-259 then
|
||||||
|
Error('LZW too many codes');
|
||||||
// grow table
|
// grow table
|
||||||
if TableCount>=TableCapacity then begin
|
if TableCount>=TableCapacity then begin
|
||||||
TableCapacity:=TableCapacity*2+128;
|
TableCapacity:=TableCapacity*2+128;
|
||||||
@ -2223,7 +2225,6 @@ var
|
|||||||
inc(TableCount);
|
inc(TableCount);
|
||||||
case TableCount+259 of
|
case TableCount+259 of
|
||||||
512,1024,2048: inc(CurBitLength);
|
512,1024,2048: inc(CurBitLength);
|
||||||
4096: Error('LZW too many codes');
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user