Do not allow empty roi extraction from GpuMat

This commit is contained in:
gagik 2024-10-16 19:49:16 +04:00
parent 8e5dbc03fe
commit f94eab1abd

View File

@ -149,9 +149,9 @@ cv::cuda::GpuMat::GpuMat(const GpuMat& m, Rect roi) :
{
data += roi.x * elemSize();
CV_Assert( 0 <= roi.x && 0 <= roi.width &&
CV_Assert( 0 <= roi.x && 0 < roi.width &&
roi.x + roi.width <= m.cols &&
0 <= roi.y && 0 <= roi.height &&
0 <= roi.y && 0 < roi.height &&
roi.y + roi.height <= m.rows );
if (refcount)