Skip to content

validate convolve kernel values are numbers - #4549

Merged
lovell merged 1 commit into
lovell:mainfrom
metsw24-max:convolve-validate-kernel-numbers
Jun 18, 2026
Merged

lovell merged 1 commit into
lovell:mainfrom
metsw24-max:convolve-validate-kernel-numbers

Conversation

@metsw24-max

Copy link
Copy Markdown
Contributor

convolve validates the kernel width, height and that the flattened kernel array has the expected length, but never checks the entries themselves are numbers, unlike the sibling affine, linear and recomb operators which all guard their input with is.number. a NaN entry therefore passes straight through to the native convolution mask and produces a silently wrong (all-zero) result, whilst a string or null entry surfaces only the vague "A number was expected" from the native layer rather than the usual invalid-parameter error. the safer behaviour is to reject a malformed kernel up front, so this adds the same per-entry is.number check to the existing kernel validation, keeping the contract consistent with its siblings. the added tests cover the string and NaN cases, both of which slip through today.

@lovell
lovell merged commit 61210b4 into lovell:main Jun 18, 2026
32 checks passed
@lovell

lovell commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Thanks again!

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.

2 participants