Commit 2b6aa50b authored by Kuang Fangjun's avatar Kuang Fangjun

avoid negative index.

parent 23fc96e9
...@@ -44,7 +44,7 @@ static const char* getTestOpMath(unsigned testOp) ...@@ -44,7 +44,7 @@ static const char* getTestOpMath(unsigned testOp)
const char* depthToString_(int depth) const char* depthToString_(int depth)
{ {
static const char* depthNames[] = { "CV_8U", "CV_8S", "CV_16U", "CV_16S", "CV_32S", "CV_32F", "CV_64F", "CV_USRTYPE1" }; static const char* depthNames[] = { "CV_8U", "CV_8S", "CV_16U", "CV_16S", "CV_32S", "CV_32F", "CV_64F", "CV_USRTYPE1" };
return depth <= CV_USRTYPE1 ? depthNames[depth] : NULL; return (depth <= CV_USRTYPE1 && depth >= 0) ? depthNames[depth] : NULL;
} }
const cv::String typeToString_(int type) const cv::String typeToString_(int type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment