-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
cvtColor should check for even dimensions in COLOR_YUV2RGB_* #21035
Copy link
Copy link
Closed
Description
System information (version)
- OpenCV => 4.5.4
- Operating System / Platform => Ubuntu
- Compiler => clang
Detailed description
When using cvtColor with COLOR_YUV2BGR_UYVY (or any COLOR_YUV2BGR_*), the code assumes the width to be even while it should be checked for it (probably something to add to CvtHelper).
The assumption is made here:
opencv/modules/imgproc/src/color_yuv.simd.hpp
Line 1758 in d934bb1
| for (; i < 2 * width; i += 4, row += dcn*2) |
(i+=4 is done while we do not even know if 2*width is a multiple of 4).
Steps to reproduce
Use a simple 1x1 CV8U_C2 matrix and the code will run but will read data outside the matrix (which should be 1x2).
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there
Reactions are currently unavailable