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

fix(fits): Make sure to close if open fails to find right magic number #3771

Merged
merged 1 commit into from
Feb 12, 2023

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Feb 12, 2023

There are two ways to fail the FITS magic number check: fail to read the bytes, or the bytes don't match the magic number. It seemed suspicious that we call close() for the latter but not the former. Combine them into a single error response (they had the same message, anyway).

Also, make sure FitsInput::init() fully clears some other data structures. Oversight?

I don't know if any of these things are real bugs, but they look sloppy and potentially problematic, so fixing them up.

There are two ways to fail the FITS magic number check: fail to read
the bytes, or the bytes don't match the magic number. It seemed
suspicious that we call close() for the latter but not the
former. Combine them into a single error response (they had the same
message, anyway).

Also, make sure FitsInput::init() fully clears some other data
structures.  Oversight?

I don't know if any of these things are real bugs, but they look
sloppy and potentially problematic, so fixing them up.
@lgritz lgritz added this pull request to the merge queue Feb 12, 2023
Merged via the queue into AcademySoftwareFoundation:master with commit fa9dade Feb 12, 2023
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Feb 13, 2023
AcademySoftwareFoundation#3771)

There are two ways to fail the FITS magic number check: fail to read
the bytes, or the bytes don't match the magic number. It seemed
suspicious that we call close() for the latter but not the
former. Combine them into a single error response (they had the same
message, anyway).

Also, make sure FitsInput::init() fully clears some other data
structures.  Oversight?

I don't know if any of these things are real bugs, but they look
sloppy and potentially problematic, so fixing them up.
@lgritz lgritz deleted the lg-fits branch February 13, 2023 05:33
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.

1 participant