var
p: TPortableNetworkGraphic;
begin
p := TPortableNetworkGraphic.Create;
try
p.LoadFromFile( './error.png');
except
on e: exception do begin
showmessage( e.message);
end;
end;
throws a "data error".
This is coming from zinflate.pas lines 438-445
if (z.state^.sub.check.was <> z.state^.sub.check.need) then
begin
z.state^.mode := BAD;
z.msg := 'incorrect data check';
z.state^.sub.marker := 5; { can't try inflateSync }
continue; { break C-switch }
end;
I have no idea why this png would fail. I ran the PNG checker and PNG analyzer, both report no errors. Nor does any other tool so far (browsers, linux).
Is this an error in the zlib code of fpc? Or what is going wrong with this png file?
(Lazarus 1.8.4 / FPC 3.0.4 / SVN 57952 / win64)