-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
putText fails with empty std::string #5451
Copy link
Copy link
Closed
Description
putText throws a segmentation fault when an empty std::string is passed as the text argument. It doesn't happen with an "empty" char array:
cv::Mat im(640, 480, CV_8UC3);
std::cout << "a" << std::endl;
cv::putText(im, "", cv::Point(10, 30), cv::FONT_HERSHEY_PLAIN,
1., cv::Scalar(255, 255, 255));
std::cout << "b" << std::endl;
cv::putText(im, std::string(""), cv::Point(10, 30), cv::FONT_HERSHEY_PLAIN,
1., cv::Scalar(255, 255, 255));
std::cout << "c" << std::endl;Output:
a
b
Segmentation fault (core dumped)
OpenCV version 3.0.0. GCC g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4. Linux 3.16.0-50-generic x86_64.
Reactions are currently unavailable