Skip to content

Fix data overflow problem in GaussianBlur#20135

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
mightbxg:bugfix_GaussianBlur
May 25, 2021
Merged

Fix data overflow problem in GaussianBlur#20135
opencv-pushbot merged 1 commit intoopencv:3.4from
mightbxg:bugfix_GaussianBlur

Conversation

@mightbxg
Copy link
Copy Markdown
Contributor

@mightbxg mightbxg commented May 21, 2021

See issue #20121

The SIMD code in smooth.simd.hpp adds two pixel values before multiplying by weights, which leads to data overflow:

v_mul_expand(vx_load(src + j * cn) + vx_load(src + (n - 1 - j)*cn), vx_setall_u16((uint16_t) *((uint32_t*)(m + j))), v_add0, v_add1);

Both 3.4 and master branches are affected.

Test case is also added in this PR.

relates #18983

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@vpisarev vpisarev self-assigned this May 25, 2021
@vpisarev
Copy link
Copy Markdown
Contributor

thank you! 👍

@vpisarev vpisarev self-requested a review May 25, 2021 07:37
@opencv-pushbot opencv-pushbot merged commit 4a2adba into opencv:3.4 May 25, 2021
This was referenced May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants