dropbox / lepton

Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/
Apache License 2.0
5.01k stars 355 forks source link

lepton crash with specific image #150

Open ConcoctionSec opened 2 years ago

ConcoctionSec commented 2 years ago

Version

lepton v1.0-

Environment

Ubuntu 18.04,64 bit

Command

Compile test program:

$ mkdir -p build
$ cd build
$ cmake ..
$ make -j8

Result

$ ./lepton -unjailed crash01.jpg out.lep

lepton v1.0-
START ACHIEVED 1631859398 47796
size mismatch in marker segment FF D4TS_MAIN    (0) 0.000000
TS_MODEL_INIT_BEGIN (0) 0.000365
TS_MODEL_INIT   (0) 0.001008
TS_THREAD_STARTED   (0) 0.001008
TS_READ_STARTED (0) 0.001058
TS_READ_FINISHED    (0) 0.001932
TS_JPEG_DECODE_STARTED  (0) 0.001932
TS_JPEG_DECODE_FINISHED (0) 0.001935
TS_DONE (0) 0.001936
4309848084 bytes needed to decompress this file
UNSUPPORTED_JPEG
SHORT_READ

Issue address:https://github.com/dropbox/lepton/issues/101

./lepton -unjailed -permissive /crash01.jpg out.lep

lepton v1.0-
Input file unable to be opened for writing:/crash01.jpg
read: Bad file descriptor
Failed to read 2 byte header
UNSUPPORTED_JPEG

Description

We have encountered an issue with lepton when encoding specific jpg image.

Poc

Poc file is this.