From dff7037156779920c3094cad64e828a66b8b9873 Mon Sep 17 00:00:00 2001 From: Aman Verma Date: Tue, 6 Oct 2015 14:23:27 +0000 Subject: [PATCH] Adding fix for issue 5451 "putText fails with empty std::string" --- modules/imgproc/src/drawing.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/imgproc/src/drawing.cpp b/modules/imgproc/src/drawing.cpp index d2a7c03cd..a968943f4 100644 --- a/modules/imgproc/src/drawing.cpp +++ b/modules/imgproc/src/drawing.cpp @@ -2090,6 +2090,10 @@ void putText( InputOutputArray _img, const String& text, Point org, int thickness, int line_type, bool bottomLeftOrigin ) { + if ( text.empty() ) + { + return; + } Mat img = _img.getMat(); const int* ascii = getFontData(fontFace);