Skip to content

Commit

Permalink
Merge pull request #52 from unbe/null-pointer-access-in-hocr
Browse files Browse the repository at this point in the history
Fix null pointer dereference when writing font name into HOCR.
  • Loading branch information
zdenop committed Jul 20, 2015
2 parents da94893 + 2b6801e commit e4f4893
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 e4f4893

Please sign in to comment.