mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
fix zero length std::string in putText()
This commit is contained in:
parent
33f5ac5c15
commit
f2decec3e8
@ -2111,7 +2111,7 @@ void putText( InputOutputArray _img, const String& text, Point org,
|
||||
pts.reserve(1 << 10);
|
||||
const char **faces = cv::g_HersheyGlyphs;
|
||||
|
||||
for( int i = 0; text[i] != '\0'; i++ )
|
||||
for( int i = 0; i < (int)text.size(); i++ )
|
||||
{
|
||||
int c = (uchar)text[i];
|
||||
Point p;
|
||||
@ -2158,7 +2158,7 @@ Size getTextSize( const String& text, int fontFace, double fontScale, int thickn
|
||||
int cap_line = (ascii[0] >> 4) & 15;
|
||||
size.height = cvRound((cap_line + base_line)*fontScale + (thickness+1)/2);
|
||||
|
||||
for( int i = 0; text[i] != '\0'; i++ )
|
||||
for( int i = 0; i < (int)text.size(); i++ )
|
||||
{
|
||||
int c = (uchar)text[i];
|
||||
Point p;
|
||||
|
Loading…
Reference in New Issue
Block a user