Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#52 from unbe/null-pointer-access-in-…
Browse files Browse the repository at this point in the history
…hocr

Fix null pointer dereference when writing font name into HOCR.
  • Loading branch information
zdenop committed Jul 20, 2015
2 parents 40094ff + 8e4df41 commit 2e8acb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,10 @@ char* TessBaseAPI::GetHOCRText(int page_number) {
hocr_str.add_str_int(" ", bottom);
hocr_str.add_str_int("; x_wconf ", res_it->Confidence(RIL_WORD));
if (font_info) {
hocr_str += "; x_font ";
hocr_str += HOcrEscape(font_name);
if (font_name) {
hocr_str += "; x_font ";
hocr_str += HOcrEscape(font_name);
}
hocr_str.add_str_int("; x_fsize ", pointsize);
}
hocr_str += "'";
Expand Down

0 comments on commit 2e8acb8

Please sign in to comment.