Destroy box before potentially exiting function

This commit is contained in:
Julian Gilbey 2020-05-12 15:25:16 +01:00
parent d3a0768c32
commit ca5735efcb

View File

@ -196,8 +196,8 @@ ImageData* Tesseract::GetRectImage(const TBOX& box, const BLOCK& block,
Box* clip_box = boxCreate(revised_box->left(), height - revised_box->top(),
revised_box->width(), revised_box->height());
Pix* box_pix = pixClipRectangle(pix, clip_box, nullptr);
if (box_pix == nullptr) return nullptr;
boxDestroy(&clip_box);
if (box_pix == nullptr) return nullptr;
if (num_rotations > 0) {
Pix* rot_pix = pixRotateOrth(box_pix, num_rotations);
pixDestroy(&box_pix);