Yes, the gz is broken. I am not sure but I think I found the problem:
the following issue seem to be the reason for this.
In the inflate_blocks function, located in the infblock.pas:
t := inflate_trees_dynamic(257 + (t and $1f),
1 + ((t shr 5) and $1f),
s.sub.trees.blens^, bl, bd, tl, td, s.hufts^, z);
freemem(s.sub.trees.blens);
This cleans up the trees.blens pointer, but it does not set it to NIL.
I assume you have to set the s.sub.trees.blens := nil afterwards. Otherwise you get a problem when you free up the structures.
It then will crash here:
procedure inflate_blocks_reset (var s : inflate_blocks_state;
var z : z_stream;
c : Pcardinal); { check value on output }
begin
if (c <> nil) then
c^ := s.check;
if (s.mode = BTREE) or (s.mode = DTREE) then
freemem(s.sub.trees.blens);
...
This is something happen very rarely and in my case (the app does not usually have heaprtc enabled when it is delivered to the users) very rarely. But every now and then a broken gz file can cause such a problem.
Christian