During decompression, before writing the garbage data, bind the output to match the file plain text size. While this logic usually does nothing and seems unneeded, it matches the Lepton C++ implementation and solves a back-compat case for a JPEG file with trailing restarts that were missing in the original JPG.
During decompression, before writing the garbage data, bind the output to match the file plain text size. While this logic usually does nothing and seems unneeded, it matches the Lepton C++ implementation and solves a back-compat case for a JPEG file with trailing restarts that were missing in the original JPG.