I tested your code with Laz 3.4/FPC 3.2.2 (32 bit and 64 bit), Laz main/FPC 3.2.2 (32 bit and 64 bit) and with Laz main/FPC main, all on Windows 11, and with Laz 3.4/FPC 3.2.2 on Kubuntu 24.04, and did not get an error. Which Laz/FPC versions are you using, and on with operating system?