mirror of
https://github.com/opencv/opencv.git
synced 2026-12-05 22:45:01 -06:00
cv::stylization always drives Domain_Filter::filter() with NORMCONV_FILTER, which calls compute_NCfilter on the working matrix and its transpose each iteration. When either has a single column, the summed-area-table index math can produce a negative offset that reads past the box_filter buffer. A single column has no neighbor to convolve across, so the correct result is an unchanged output -- exactly what compute_Rfilter already does for w==1 via its no-op loop bounds. Return early instead of running the box-filter math in that case. Fixing compute_NCfilter directly (rather than guarding cv::stylization's input, as suggested in the issue) also covers cv::edgePreservingFilter when called with NORMCONV_FILTER, and covers single-row inputs, which hit the identical bug through the internal transposed pass. Closes #29614