lz4-delphi icon indicating copy to clipboard operation
lz4-delphi copied to clipboard

Bug in lz4d.pas

Open Acetylator opened this issue 10 years ago • 1 comments

Hi, you got bug in lz4d.pas. On line 386, you got: LBytes := lz4s_Decode_Stream_Header( LSD, ASource, LBytes ); It should be: LBytes := lz4s_Decode_Stream_Header(LSD, ASource, ASourceSize);

LBytes is 0 when you call this lz4s_Decode_Stream_Header, therefore you will always get an exception.

Cheers, Ace.

Acetylator avatar Jun 11 '15 17:06 Acetylator

Hi, THX for the report. I will look into it when i have some spare time. Hopefully next week.

Hugie avatar Jun 11 '15 18:06 Hugie

Actually LBytes is not initialized, so it has some random value that might be >=7 so the exception will not necessarily occur (it didn't in my tests, I only found this due to a compiler warning). It's a bug nonetheless.

dummzeuch avatar Jun 14 '24 20:06 dummzeuch

fixed

dummzeuch avatar Jun 15 '24 13:06 dummzeuch