Skip to content

Commit

Permalink
Fix null pointer dereference when writing font name into HOCR.
Browse files Browse the repository at this point in the history
  • Loading branch information
unbe committed Jul 19, 2015
1 parent 43834da commit 2b6801e
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 2b6801e

Please sign in to comment.