Tesseract: Some possible problems

Created on 2 Jan 2019  路  8Comments  路  Source: tesseract-ocr/tesseract

All 8 comments

What tool did you use to find these issues?

PVS Studio? Do you have a license for it or do you use the free license option?

@amitdo
Yes, it's PVS studio. I have a license)

This is their new offering:
https://www.viva64.com/en/b/0600/

As far as I see only the 2nd points at a real problem.

@stweil why do you think division by zero is safe?

It's conditionally, and the condition is never true if the difference is 0 (unless there is a negative line_size which should never happen).

@stweil can you please explain the reason it is never true if the difference is 0?
It's not clear to me

The division is only executed if last_x - left_x > block->line_size * 2. A division by zero would occur if last_x - left_x == 0, that means only if 0 > block->line_size * 2 or rearranged block->line_size < 0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clarkk picture clarkk  路  6Comments

johnthagen picture johnthagen  路  6Comments

royudev picture royudev  路  5Comments

clarkk picture clarkk  路  7Comments

dthrock picture dthrock  路  5Comments