1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00
Files
opencv/modules/imgproc
orbisai0security 357ad24262 Merge pull request #28915 from orbisai0security:fix-v-001-filter-memcpy-bounds-check
fix: Guard ndsrvp filter center copy when source span is empty #28915

## Summary
This adds a defensive guard around the centre-region `memcpy` in the ndsrvp HAL filter padding path.

**Description**: Multiple memcpy calls in the ndsrvp HAL filter, bilateral filter, and median blur routines use computed sizes (e.g., cnes * (rborder - j), cn * (rborder - j), src_step * height) without validating that the computed byte count fits within the destination buffer. An attacker supplying a crafted image with manipulated dimensions, channel counts, or border parameters can cause the computed copy size to exceed the allocated destination buffer, resulting in a heap buffer overflow that corrupts adjacent memory.

## Changes
- `hal/ndsrvp/src/filter.cpp`

## Verification
- [x] Build passes
- [x] Scanner re-scan confirms fix
- [x] LLM code review passed

---
*Automated security fix by [OrbisAI Security](https://orbisappsec.com)*
2026-05-14 07:52:08 +03:00
..
2025-03-19 21:38:08 +05:30