Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LJpegDecompressor: support degenerate raws with width % 2 != 0
This is needed e.g for DNG's converted from Panasonic DMC-LX1 raws. I have no words. What were they (Adobe) thinking. They discard padding columns, that were garbage, and end up with such an odd raw, where the tiles (LJPEG-compressed) still have padding, yet the DNG image sizes specify that it has to be discarded. What is even worse, the image width is not multiple of two, and the LJPEG's components-per-pixel is 2, so we have to very-special-handle this case, to not completely discard that last required block (then we'd be producing nondeterministic garbage in those last few columns), but also not fully decode it, because we don't have anywhere to write it, We could, of course, introduce something like "internal padding columnts", in fact we already pad the rows to be 16-byte aligned, but that padding is used for ASAN overflow detection. So right now i'm not seeing any more reasonable fix. :/ Fixes https://redmine.darktable.org/issues/12239
- Loading branch information
Showing
2 changed files
with
72 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters