Skip to content

Fix a panic in lighting filters on a region smaller than the input - #1144

Open
teolines wants to merge 1 commit into
linebender:mainfrom
teolines:fix-lighting-region-mismatch
Open

teolines wants to merge 1 commit into
linebender:mainfrom
teolines:fix-lighting-region-mismatch

Conversation

@teolines

Copy link
Copy Markdown

Tiny elements with a lighting filter crashed because rounding made the filter area 1px smaller than the input. The output now matches the input size.

Fixes #1141

LLM Contributions: investigation, implementation and tests with Claude Code, reviewed by me. The description is my own, edited for grammar.

The filter region comes from rounding the transformed filter rect, while
the source pixmap comes from rounding the layer bounding box, so the
region can be a pixel smaller than the input. The lighting filters
allocated their output for the region but iterate over the input, and
wrote past the end of the output.

Allocate the output with the size of the input, like the other filters
that transform their input.

Fixes linebender#1141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when rendering lighting filters: index out of bounds

1 participant