提交 773262bc 编写于 作者: F Federico Martinez 提交者: Alexander Alekhin

Fix UB in CopyMakeConstBoder_8u

Caused by overflow of arithmetic operators conversion rank
上级 20a46b31
......@@ -1325,13 +1325,12 @@ void copyMakeConstBorder_8u( const uchar* src, size_t srcstep, cv::Size srcroi,
memcpy( dstInner + srcroi.width, constBuf, right );
}
dst += dststep*top;
for( i = 0; i < top; i++ )
memcpy(dst + (i - top)*dststep, constBuf, dstroi.width);
memcpy(dst + i * dststep, constBuf, dstroi.width);
dst += (top + srcroi.height) * dststep;
for( i = 0; i < bottom; i++ )
memcpy(dst + (i + srcroi.height)*dststep, constBuf, dstroi.width);
memcpy(dst + i * dststep, constBuf, dstroi.width);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册