Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent uninitialized integer from being used for x_fsize output #1125

Closed
wants to merge 1 commit into from

Conversation

ftzdomino
Copy link

If font_name is false, then res_it->WordFontAttributes and pointsize is uninitialized. This results in seemingly random data being written to the hocr output for x_fsize. This change moves the output of x_fsize into the check that verifies the function that initializes pointsize actually ran, preventing the output of the uninitialized value.

If font_name is false, then res_it->WordFontAttributes and pointsize is uninitialized.  This results in seemingly random data being written to the hocr output for x_fsize.
@stweil
Copy link
Member

stweil commented Sep 13, 2017

Do you have a simple test case where there is no font_name?

@amitdo
Copy link
Collaborator

amitdo commented Sep 13, 2017

I'm sorry but that's not the right solution.

@amitdo
Copy link
Collaborator

amitdo commented Sep 13, 2017

Here is Ray's suggestion:
#1074 (comment)

And here is mine:
#1074 (comment)

@amitdo
Copy link
Collaborator

amitdo commented Sep 13, 2017

so I suggested to move pointsize to the RowAttributes() method.

Actually, it's better to use function overloading for RowAttributes() to not break the C++ API.

@amitdo
Copy link
Collaborator

amitdo commented Oct 20, 2017

The issue that this PR tries to solve was fixed in #1173.

@zdenop, please close this PR.

@zdenop zdenop closed this Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants