mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 23:21:57 +02:00
* fix buffer handling in flush
git-svn-id: trunk@10080 -
This commit is contained in:
parent
9288ead792
commit
f5131f591a
@ -217,11 +217,6 @@ var err:smallint;
|
||||
begin
|
||||
{Compress remaining data still in internal zlib data buffers.}
|
||||
repeat
|
||||
err:=deflate(Fstream,Z_FINISH);
|
||||
if err=Z_STREAM_END then
|
||||
break;
|
||||
if err<>Z_OK then
|
||||
raise Ecompressionerror.create(zerror(err));
|
||||
if Fstream.avail_out=0 then
|
||||
begin
|
||||
{ Flush the buffer to the stream and update progress }
|
||||
@ -232,6 +227,11 @@ begin
|
||||
Fstream.next_out:=Fbuffer;
|
||||
Fstream.avail_out:=bufsize;
|
||||
end;
|
||||
err:=deflate(Fstream,Z_FINISH);
|
||||
if err=Z_STREAM_END then
|
||||
break;
|
||||
if (err<>Z_OK) then
|
||||
raise Ecompressionerror.create(zerror(err));
|
||||
until false;
|
||||
if Fstream.avail_out<bufsize then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user