Skip to content

Commit 6f85de2

Browse files
authored
WordFontAttributes: Check that word != nullptr earlier. Fix #1665
1 parent 8b64602 commit 6f85de2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ccmain/ltrresultiterator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ const char* LTRResultIterator::WordFontAttributes(bool* is_bold,
166166
bool* is_smallcaps,
167167
int* pointsize,
168168
int* font_id) const {
169+
if (it_->word() == nullptr) return nullptr; // Already at the end!
169170
float row_height = it_->row()->row->x_height() +
170171
it_->row()->row->ascenders() - it_->row()->row->descenders();
171172
// Convert from pixels to printers points.
172173
*pointsize = scaled_yres_ > 0
173174
? static_cast<int>(row_height * kPointsPerInch / scaled_yres_ + 0.5)
174175
: 0;
175-
if (it_->word() == nullptr) return nullptr; // Already at the end!
176176
if (it_->word()->fontinfo == nullptr) {
177177
*font_id = -1;
178178
return nullptr; // No font information.

0 commit comments

Comments
 (0)