Skip to content

Fix OOB read in lut3d cube, 3dl and compressed LUT paths - #21494

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
Arecsu:master
Jul 7, 2026
Merged

TurboGit merged 1 commit into
darktable-org:masterfrom
Arecsu:master

Conversation

@Arecsu

@Arecsu Arecsu commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The interpolation functions use for_each_channel() which reads DT_PIXEL_SIMD_CHANNELS (4) floats per LUT grid point, but each entry has only 3 components. When processing the last grid point (level³ - 1), the SIMD read overruns the buffer by 1 float.

This was already fixed for the HALD PNG path in commit e14e55d. This patch extends the same over-allocation (+1 float, zeroed) to the .cube, .3dl and compressed GMIC LUT loading paths.

Fixes #21493

@Arecsu
Arecsu force-pushed the master branch 2 times, most recently from 9c15cfb to 74b2bce Compare July 6, 2026 00:41
The interpolation functions use for_each_channel() which reads
DT_PIXEL_SIMD_CHANNELS (4) floats per LUT grid point, but each entry
has only 3 components. The last grid point access overruns the buffer
by 1 float.

This was already fixed for the HALD PNG path in commit e14e55d.
Apply the same over-allocation (+1 float, zeroed) to the .cube, .3dl
and compressed GMIC LUT loading paths.
@jenshannoschwalm jenshannoschwalm self-assigned this Jul 7, 2026
@jenshannoschwalm jenshannoschwalm added this to the 5.6.1 milestone Jul 7, 2026
@jenshannoschwalm jenshannoschwalm added the bugfix pull request fixing a bug label Jul 7, 2026
@TurboGit

TurboGit commented Jul 7, 2026

Copy link
Copy Markdown
Member

Needs a release note entry, TIA.

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@TurboGit
TurboGit merged commit c6d4ee2 into darktable-org:master Jul 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV in _correct_pixel_tetrahedral/pyramid in lut3d + bright AGX module values on Apple Silicon

3 participants