Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#156 from stweil/master
Browse files Browse the repository at this point in the history
pdfrenderer: Fix uninitialized local variables
  • Loading branch information
zdenop committed Nov 27, 2015
2 parents f4c69a8 + 57402b4 commit a7ffd0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ char* TessPDFRenderer::GetPDFTextObjects(TessBaseAPI* api,
pdf_str.add_str_double("", prec(height));
pdf_str += " 0 0 cm /Im1 Do Q\n";

int line_x1 = 0;
int line_y1 = 0;
int line_x2 = 0;
int line_y2 = 0;

ResultIterator *res_it = api->GetIterator();
while (!res_it->Empty(RIL_BLOCK)) {
if (res_it->IsAtBeginningOf(RIL_BLOCK)) {
Expand All @@ -319,7 +324,6 @@ char* TessPDFRenderer::GetPDFTextObjects(TessBaseAPI* api,
new_block = true; // Every block will declare its affine matrix
}

int line_x1, line_y1, line_x2, line_y2;
if (res_it->IsAtBeginningOf(RIL_TEXTLINE)) {
int x1, y1, x2, y2;
res_it->Baseline(RIL_TEXTLINE, &x1, &y1, &x2, &y2);
Expand Down

0 comments on commit a7ffd0e

Please sign in to comment.