google / wuffs

Wrangling Untrusted File Formats Safely
Other
4.06k stars 129 forks source link

[JPEG] unsupported DQT after SOF markers #120

Closed syoyo closed 1 year ago

syoyo commented 1 year ago

I've encounter here for a jpeg.

https://github.com/google/wuffs/blob/5ab65d0923b67c245eb20e4bee97b13de1c18154/std/jpeg/decode_jpeg.wuffs#L707

Is it ok to simply call this.decode_dqt like here?

https://github.com/google/wuffs/blob/5ab65d0923b67c245eb20e4bee97b13de1c18154/std/jpeg/decode_jpeg.wuffs#LL278C33-L278C33

How to reproduce

jpeg is too big to attach.

You can extract a reproducible jpeg data(semantic layer) from ProRAW DNG: https://9to5mac.com/2022/10/07/iphone-14-pro-48mp/

$ git cone https://github.com/syoyo/tinydng
$ cd tinydng
$ git checkout wuffs
$ make
$ ./test input.dng

There will be layer-1.jpg, then feed it to wuff jpeg decoder.

Here is an example of screenshot of jpeg: 48MP Tower Bridge through glass

Screenshot from 2023-05-19 20-19-50

syoyo commented 1 year ago

🙏