mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 22:50:59 +02:00
parent
10d4b8e66f
commit
2cd78c03b3
@ -742,27 +742,30 @@ procedure TFPReaderPNG.DoDecompress;
|
||||
end
|
||||
else
|
||||
l := ScanLineLength[rp]*ByteWidth;
|
||||
GetMem (FPreviousLine, l);
|
||||
GetMem (FCurrentLine, l);
|
||||
fillchar (FCurrentLine^,l,0);
|
||||
try
|
||||
for ry := 0 to CountScanlines[rp]-1 do
|
||||
begin
|
||||
FSwitchLine := FCurrentLine;
|
||||
FCurrentLine := FPreviousLine;
|
||||
FPreviousLine := FSwitchLine;
|
||||
Y := CalcY(ry);
|
||||
Decompress.Read (lf, sizeof(lf));
|
||||
Decompress.Read (FCurrentLine^, l);
|
||||
if lf <> 0 then // Do nothing when there is no filter used
|
||||
for rx := 0 to l-1 do
|
||||
FCurrentLine^[rx] := DoFilter (lf, rx, FCurrentLine^[rx]);
|
||||
HandleScanLine (y, FCurrentLine);
|
||||
end;
|
||||
finally
|
||||
freemem (FPreviousLine);
|
||||
freemem (FCurrentLine);
|
||||
end;
|
||||
if (l>0) then
|
||||
begin
|
||||
GetMem (FPreviousLine, l);
|
||||
GetMem (FCurrentLine, l);
|
||||
fillchar (FCurrentLine^,l,0);
|
||||
try
|
||||
for ry := 0 to CountScanlines[rp]-1 do
|
||||
begin
|
||||
FSwitchLine := FCurrentLine;
|
||||
FCurrentLine := FPreviousLine;
|
||||
FPreviousLine := FSwitchLine;
|
||||
Y := CalcY(ry);
|
||||
Decompress.Read (lf, sizeof(lf));
|
||||
Decompress.Read (FCurrentLine^, l);
|
||||
if lf <> 0 then // Do nothing when there is no filter used
|
||||
for rx := 0 to l-1 do
|
||||
FCurrentLine^[rx] := DoFilter (lf, rx, FCurrentLine^[rx]);
|
||||
HandleScanLine (y, FCurrentLine);
|
||||
end;
|
||||
finally
|
||||
freemem (FPreviousLine);
|
||||
freemem (FCurrentLine);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user