Commit Graph

36449 Commits

Author SHA1 Message Date
Andrei Fedorov
7075c595ae Update matchtemplate_ipp.cpp 2026-08-11 18:51:01 +02:00
Alexander Smorkalov
49c8d21f16 Merge pull request #29674 from karpovantonme:docs/read-options-param
imgcodecs: name the parameter setReadOptions actually takes 🤖🤖🤖
2026-08-11 09:34:52 +03:00
Alexander Smorkalov
bbab7da39f Merge pull request #29563 from developer0hye:agent/msmf-close-event-handle
videoio(MSMF): close leaked SourceReaderCB Event handle 🤖🤖🤖
2026-08-11 09:31:30 +03:00
Alexander Smorkalov
dea9ce421d Merge pull request #28517 from asmorkalov:as/charuco_bindings
Fixed bindings generation for Charuco boards #28517

Fixes https://github.com/opencv/opencv/issues/28512

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the 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
2026-08-10 19:45:53 +03:00
Alexander Smorkalov
d53047927b Merge pull request #29661 from anupamme:fix-repo-opencv-v004-bilateral-filter-integer-overflow
harden: add integer overflow check in bilateralFilter.cpp
2026-08-10 19:33:49 +03:00
aryan chaudhary
9b1aa94e69 Merge pull request #29623 from Aryan171:fix/features2d-akaze-subsample-overflow
features2d: fix heap buffer overflow in AKAZE generateDescriptorSubsample #29623

Prevent out-of-bounds write in `generateDescriptorSubsample()` during AKAZE MLDB descriptor generation when `nchannels < 3` (e.g. `nchannels = 2`).

Fixes #29613 

### Summary of Changes

- **Module:** `features2d` (AKAZE)
- **Problem:** When `generateDescriptorSubsample()` is called with `nchannels < 3`, the code hardcoded 3-channel matrix index offsets (`+ 0`, `+ 1`, `+ 2`). Since `comps` allocates rows based on `nchannels * npicks`, writing to index offset `+ 2` when `nchannels = 2` causes a heap buffer overflow past the last row of `comps`.
- **Fix:** Replaced hardcoded 3-channel matrix index assignments with a dynamic loop that iterates over `0` to `nchannels - 1`.
- **Regression Test:** Added `Features2D_AKAZE.Subsample_Channels_Overflow_Fix` in `modules/features2d/test/test_akaze.cpp`.
- 
### Acknowledgments

Thanks to @abhishek-gola for reviewing the test and suggesting the correct approach.

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch (`4.x`)
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2026-08-10 15:26:45 +03:00
Anton Karpov
2459ac65fe imgcodecs: name the parameter setReadOptions actually takes 2026-08-07 15:04:27 +03:00
Abhishek Gola
77dfa297d0 Merge pull request #29640 from yvonnelxxxx/fix/int-overflow-absdiff
fix: signed-integer-overflow in c_absdiff<int>
2026-08-06 19:29:06 +05:30
Abhishek Gola
59a0461d50 Merge pull request #29567 from Adel-Ayoub/fix/tiff-planar-decode
imgcodecs: fix decoding of TIFF images with separate planes
2026-08-06 19:09:46 +05:30
Abhishek Gola
49ca26154e Merge pull request #29554 from mvanhorn/fix/29279-ipp-warpaffine-nearest-bitexact
imgproc: route IPP warpAffine INTER_NEAREST to native kernel for bit-exactness 🤖🤖🤖
2026-08-06 19:09:35 +05:30
Abhishek Gola
3ea443b670 Merge pull request #29667 from intel-staging/ipp/iw_build_fix
Build fix: IPP integration wrapers
2026-08-06 13:37:50 +05:30
Abhishek Gola
a21f7a1d1b Merge pull request #29668 from karpovantonme/docs/memset-param-names
dnn: fix the parameter names documented for memset 🤖🤖🤖
2026-08-06 13:32:30 +05:30
Adel-Ayoub
ff6112c09e imgcodecs: fix decoding of TIFF images with separate planes 2026-08-05 23:26:27 +01:00
Anton Karpov
f625c00f5a dnn: fix the parameter names documented for memset
The four memset overloads in cuda4dnn document their first parameter as
src while it is called dest, and the directions are the wrong way round:
the output buffer is marked [in] and the 8-bit fill value is marked [out].

The prose above two of them already says dest, only the tags disagree.
2026-08-05 15:48:52 +03:00
Victor Getmanskiy
64a04b540a Build fix: IPP integration wrapers 2026-08-05 12:41:12 +02:00
anupamme
5940b25d34 fix: V-004 security vulnerability
Automated security fix generated by OrbisAI Security
2026-08-04 14:18:09 +00:00
Abhishek Gola
4bee6895eb Merge pull request #29643 from uwezkhan/apng-dispose-elem-size
fix apng background dispose overrun in png readData
2026-08-04 09:56:19 +05:30
Yvonne
5a5ac33c87 make absdiff overflow test accept saturate or wraparound 2026-08-04 11:55:18 +08:00
Yvonne
154dac563f fix test for ARM 2026-08-03 17:05:41 +08:00
Abhishek Gola
6e82dddfb5 Merge pull request #29649 from kaingwade/thead_rvv_check
Update T-Head RVV check
2026-08-03 12:58:47 +05:30
Yvonne
de15c6af68 core(arithm): add regression test for cv::absdiff CV_32S overflow 2026-08-03 14:51:35 +08:00
kaingwade
caaabca123 Update T-Head RVV check 2026-08-03 10:54:36 +08:00
Uwez Khan
6ad702680e fix apng background dispose overrun in png readData 2026-08-01 02:13:45 +05:30
Matt Van Horn
92d1ebe1a0 docs: trim the NEAREST-fallback comments per review 2026-07-31 08:02:50 -07:00
Yvonne
4edef8f4bf fix signed-int-overflow in c_absdiff<int> 2026-07-31 16:53:42 +08:00
Abhishek Gola
e35ad60e4e Merge pull request #29544 from xi-guo-0/core-optimize-extract-channel-8uc2
core: optimize 8UC2 channel extraction
2026-07-30 16:49:19 +05:30
Abhishek Gola
f42fa7b214 Merge pull request #29553 from mvanhorn/fix/26746-warn-external-grfmt-fallback
cmake: warn when external image-codec library is requested but not found 🤖🤖🤖
2026-07-30 16:38:23 +05:30
Abhishek Gola
2fb7adbd53 Merge pull request #29552 from sergiud/opencl-remap-artifacts
imgproc: fix OpenCL remap negative border rounding
2026-07-30 15:46:30 +05:30
Abhishek Gola
2b6c3df954 Merge pull request #29546 from uwezkhan/dtree-split-index-bound
bound categorical split indices in dtrees readSplit
2026-07-29 13:31:38 +05:30
Abhishek Gola
a906dfbed2 Merge pull request #29626 from ArneshBanerjee/fix-29615-icvcvt-pointer-overflow-4x
imgcodecs: fix pointer overflow in 16u icvCvt helpers (4.x)
2026-07-28 19:52:22 +05:30
Arnesh Banerjee
b7860407f0 imgcodecs: fix pointer overflow in 16u icvCvt helpers
The 16-bit icvCvt_* helpers in utils.cpp move the row pointer with
step/sizeof(x[0]) - size.width*N. sizeof is unsigned, so this is done in
unsigned math. When the caller passes step == 0, it underflows to a huge
value and the pointer goes out of range, which is undefined behavior.

The TIFF decoder hits this: it walks rows itself and calls these helpers
with step = 0, so reading a 16-bit 4-channel TIFF triggers the bug.

Cast sizeof(...) to int so the math is signed. Same result for normal
calls, no overflow when the step is 0.

Added Imgcodecs_Tiff.regression_29615_16UC4 which round-trips a CV_16UC4
TIFF in memory.

This is the 4.x version of the fix, requested in
https://github.com/opencv/opencv/pull/29620 (issue #29615).
2026-07-28 16:19:17 +05:30
Uwez Khan
dee2bb288b bound categorical split indices in dtrees readSplit 2026-07-27 10:54:57 +05:30
Sergiu Deitsch
096759c0b0 imgproc: fix OpenCL remap negative rounding
Truncation toward zero produces incorrect interpolation indices for
negative border coordinates. Use nearest-even rounding so OpenCL remap
matches the CPU behavior.
2026-07-27 10:46:53 +05:30
Sergiu Deitsch
73c9537f3b imgproc: fix NVIDIA OpenCL remap kernel types
Match interpolation coefficient types to the working type so the double
kernel compiles on NVIDIA devices.
2026-07-27 10:46:53 +05:30
Alexander Smorkalov
70fc346580 Merge pull request #29549 from hanu-14:fix-https-readme-md
fix: upgrade http:// to https:// in README.md
2026-07-26 15:02:04 +03:00
Andrei Fedorov
664f59e750 Merge pull request #29542 from intel-staging:ipp/enable_instrumentation_fix
Implemented a check to enable instrumentation for IPP HAL #29542

To enable instrumentation for IPP HAL correctly it needed to generalize a part of `private.hpp` and put it to the separate file that can be included in `private.hpp` and `ipp_utils.hpp` both to avoid duplication.

Built with `-DENABLE_INSTRUMENTATION=ON` and ran `opencv_perf_imgproc --perf_instrument=1`:

  | Test | IPP weight before | IPP weight after |
  |---|---|---|
  | `distanceTransform` (8U->32F) | 0.0% | ~76% |
  | `ippSobel` | 0.0% | ~98% |
  | `scharrViaSobelFilter` | 0.0% | ~90% |

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the 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
2026-07-26 15:01:24 +03:00
Alexander Smorkalov
19ef7e6e16 Merge pull request #29583 from uditjainstjis:fix-23580-hog-buffer-overflow
objdetect: fix out-of-bounds write in HOG gaussian weights #23580 🤖🤖🤖
2026-07-25 10:01:30 +03:00
Udit Jain
c8446af29a objdetect: fix out-of-bounds write in HOG gaussian weights (blockSize.height vs width)
In HOGCache::init the block gaussian weights are computed into two buffers:
  AutoBuffer<float> di(blockSize.height), dj(blockSize.width);
The vectorized (CV_SIMD128) loop that fills dj was bounded by
`blockSize.height` instead of `blockSize.width`. When the block is taller than
it is wide, `v_store(_dj + j, ...)` writes past the end of the width-sized dj
buffer, causing a heap buffer overflow / access violation (e.g. HOGDescriptor
with a 198x281 window, or the 2399x2400 case from the report).

Bound the dj loop by `blockSize.width` to match the buffer size and the scalar
tail loop. This keeps the SIMD path (unlike the workaround in the report, which
disabled it).

Added a regression test that computes a HOGDescriptor with a tall block; without
the fix it triggers a heap-buffer-overflow (confirmed with AddressSanitizer at
hog.cpp:731 inside HOGCache::init).

Fixes #23580
2026-07-24 04:51:45 +05:30
Yuantao Feng
0e09f1a238 Merge pull request #29557 from fengyuentau:4x/hal_rvv/split_opt
hal_rvv core: Cover more data types for split with native RVV intrinsics #29557

Covering 16-bit, 32-bit and 64-bit split.

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2026-07-21 10:16:38 +03:00
Alexander Smorkalov
ba53d1d6b7 Merge pull request #29566 from fengyuentau:4x/hal_rvv/copy_mask_opt
hal_rvv core: Optimize RVV HAL masked copy
2026-07-21 10:15:07 +03:00
FENG Yuantao
1f36f15a49 Optimize RVV HAL masked copy 2026-07-20 23:43:41 +08:00
Yonghye Kwon
df9da57e4f videoio(MSMF): close SourceReaderCB event handle
SourceReaderCB owns an Event created for asynchronous frame delivery,
but its destructor did not close the handle. Close it when the callback
is destroyed to prevent one Event handle from leaking across repeated
MSMF capture lifecycles.

Fixes #29562
2026-07-20 20:21:49 +09:00
Alexander Smorkalov
2b6ea5f344 Merge pull request #29556 from fengyuentau:4x/hal_rvv/merge_opt
hal_rvv core: Optimize 32-bit and 64-bit merge
2026-07-20 12:26:12 +03:00
Xi Guo
1bf1e70c0f core: optimize 8UC2 channel extraction 2026-07-20 10:21:00 +08:00
FENG Yuantao
898f1e9691 Optimize RVV HAL 32-bit and 64-bit merge 2026-07-20 00:22:38 +08:00
Matt Van Horn
fe5ab36245 imgproc: fix IPP HAL warpAffine INTER_NEAREST not bit-exact with native
The IPP HAL (hal/ipp/src/warp_ipp.cpp) routed cv::warpAffine with
INTER_NEAREST to iwiWarpAffine for CV_16S{C1,C3,C4}, CV_64F{C1,C3,C4}
and CV_16UC4 via the non-enforced (default) impl[] dispatch table,
whose comment promises results "strictly aligned to OpenCV
implementation". That contract was broken: IPP rounds source
coordinates at the half-pixel boundary differently from the native
fixed-point kernel (warpAffineBlocklineNN, 10-bit AB_BITS), so under
rotation or fractional translation about 0.05-0.07% of destination
pixels resolve to a different source pixel. Because INTER_NEAREST does
no blending, those pixels take entirely different values, so warping
identical data as e.g. CV_16S (IPP path) versus CV_16U (native path)
produced non-identical output, and x86_64 (IPP) silently diverged from
ARM (no IPP). This is the same "Different results" behavior for which
IPP warpAffine was disabled from ~2017 through 4.11.

Zero the INTER_NEAREST column of the non-enforced dispatch table for
the affected types so the dispatch guard falls back to the native
kernel, restoring the "strictly aligned" contract. The LINEAR and
CUBIC columns for these rows were already 0, so IPP was only ever used
for NEAREST here. The IPP_CALLS_ENFORCED table is left untouched so the
opt-in performance-benchmarking build still exercises IPP.

Adds a regression test (Imgproc_Warp.regression_29279) that warps a
gradient image with INTER_NEAREST as each affected type and asserts
bit-exact equality with a native (CV_32F) reference across several
rotation angles and a fractional translation.

Fixes #29279
2026-07-18 10:12:16 -07:00
Matt Van Horn
a859f3feff cmake: warn when external grfmt library requested but not found
When a user disables a bundled image-codec dependency (e.g.
BUILD_ZLIB=OFF) to supply an external build but find_package()
cannot locate it, OpenCVFindLibsGrfmt.cmake silently falls back to
compiling the bundled 3rdparty version. As reported in the issue,
this is misleading: the editable ZLIB_LIBRARY_DEBUG/RELEASE cache
entries have no effect after the fallback and nothing points the
user at the real knob (ZLIB_ROOT / ZLIB_DIR).

Emit a message(WARNING) in each fallback branch, guarded by
NOT BUILD_<lib>, so the built-in fallback is no longer silent when
the user explicitly opted out of the bundled build. The warning
names the correct search variables for that library and points to
the CMake find_package / Find<lib> documentation. Applied
consistently to the zlib, libjpeg, libtiff, libpng and libwebp
fallback branches.

The existing fallback behavior is intentionally left unchanged, so
configurations that rely on the built-in fallback continue to build.

Fixes #26746
2026-07-18 10:02:13 -07:00
Alexander Smorkalov
6f402272e7 Merge branch 'as/release_4.14.0' into 4.x 2026-07-18 09:55:21 +03:00
MOHAMMED HANAN M T P
5ab3e2e580 fix: upgrade http:// to https:// in README.md 2026-07-18 11:13:02 +05:30
Alexander Smorkalov
0654a42e19 Release: OpenCV 4.14.0 4.14.0 2026-07-17 15:55:59 +03:00