Skip to content

Commit a57c54e

Browse files
committed
rle compress needs to over allocate
1 parent 246c90b commit a57c54e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Source/simba.compress.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ procedure CompressData(Algo: ESimbaCompressAlgo; InData: PByte; InSize: Int64; v
153153

154154
procedure CompressWithRle();
155155
begin
156-
OutSize := InSize + SizeOf(Int32);
156+
OutSize := RleCompressDestLen(InSize) + SizeOf(Int32);
157157
AllocOrGrowMemory(OutData, OutSize);
158158
OutSize := RleCompress(InData, @OutData[SizeOf(Int32)], InSize, OutSize - SizeOf(Int32));
159159
if (OutSize = -1) then

0 commit comments

Comments
 (0)