mirror of
https://github.com/opencv/opencv.git
synced 2026-11-24 02:07:54 -06:00
`u->mapcount` was incremented before `clEnqueueMapBuffer()`.
If mapping failed, the counter remained incremented even though no
mapping was established, leaving `UMatData` in an inconsistent state
and potentially triggering later assertions such as:
(-215:Assertion failed) u->mapcount == 0 in function 'deallocate'
Update the logic to increment `mapcount` only after a successful
`clEnqueueMapBuffer()` call.
The issue was observed while running:
OCL_PyrDownFixture_PyrDown.PyrDown/6 from opencv_perf_imgproc.
Assisted-by: LLM
Signed-off-by: jiajia Qian <jiajia.qian@nxp.com>