From 45e106820f69eb89cda765b2671ff44280d46032 Mon Sep 17 00:00:00 2001 From: "theraysmith@gmail.com" Date: Thu, 24 Apr 2014 00:50:27 +0000 Subject: [PATCH] Fixed issue 1116 git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@1074 d0cd1f9f-072b-0410-8dd7-cf729c803f20 --- api/baseapi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index 5be3232ea..e4448e156 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -1878,8 +1878,10 @@ bool TessBaseAPI::GetTextDirection(int* out_offset, float* out_slope) { // Get the y-coord of the baseline at the left and right edges of the // textline's bounding box. int left, top, right, bottom; - if (!it->BoundingBox(RIL_TEXTLINE, &left, &top, &right, &bottom)) + if (!it->BoundingBox(RIL_TEXTLINE, &left, &top, &right, &bottom)) { + delete it; return false; + } int left_y = IntCastRounded(*out_slope * left + *out_offset); int right_y = IntCastRounded(*out_slope * right + *out_offset); // Shift the baseline down so it passes through the nearest bottom-corner