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

Assert fail in nd_array.hh:158 #139

Closed seviezhou closed 3 years ago

seviezhou commented 4 years ago

System info

Ubuntu X64, gcc (Ubuntu 5.5.0-12ubuntu1), lepton (latest master 3d1bc1)

Configure

CFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address" ./configure

Command line

./lepton -unjailed @@ /tmp/lep.jpg

Output

START ACHIEVED 1596549152 171035
Assert Failed: i0 < s0 at (src/lepton/../vp8/util/nd_array.hh:158)
SHORT_READAborted

POC

assert-fail-nd_array-158.zip

danielrh commented 4 years ago

seems like you found an interesting issue...I'll look into it was this a specially crafted .lep file?

seviezhou commented 4 years ago

Yes, it is a crafted .lep file, maybe not valid.

danielrh commented 3 years ago

Ya it's not a valid file, but thanks for reporting. We generally use assert to validate the file format since the idea is to run a separate copy of lepton for each decode to enable jailing