mirror of
https://github.com/opencv/opencv.git
synced 2026-01-19 00:07:42 +08:00
PR #27972 added _dst.create(size(), type()) in copyTo's empty() block. In Debug builds, Mat::release() was resetting flags to MAGIC_VAL, clearing the type information and causing assertion failures when destination has fixedType(). Preserve type flags in Mat::release() debug mode by using: flags = (flags & CV_MAT_TYPE_MASK) | MAGIC_VAL Thanks to @akretz for suggesting this better approach.