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

Field3d: don't crash under opening failures #1848

Merged
merged 1 commit into from
Jan 21, 2018

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Jan 20, 2018

Field3D is supposed to just throw an exception that we can catch if it
can't open the file, but under some circumstances it just plain crashes
when asked to open a file that isn't a f3d file at all.

The reason this comes up is that OIIO's behaveior when the usual reader
can't open a file is to try ALL of them (hoping that maybe the file is
just mis-named) or the hint heuristics are wrong.

I'm not inclined to try to fix the field3d internals myself at this
moment, so for now I'm just making the OIIO field3d reader fail if the
file is not named ".f3d". This violates our intended rule of "it doesn't
matter what the file is called", but I can only rely on that if the
underlying format library is rock solid when presented a file of the
wrong type.

Field3D is supposed to just throw an exception that we can catch if it
can't open the file, but under some circumstances it just plain crashes
when asked to open a file that isn't a f3d file at all.

The reason this comes up is that OIIO's behaveior when the usual reader
can't open a file is to try ALL of them (hoping that maybe the file is
just mis-named) or the hint heuristics are wrong.

I'm not inclined to try to fix the field3d internals myself at this
moment, so for now I'm just making the OIIO field3d reader fail if the
file is not named ".f3d". This violates our intended rule of "it doesn't
matter what the file is called", but I can only rely on that if the
underlying format library is rock solid when presented a file of the
wrong type.
@lgritz lgritz merged commit 9b4f91e into AcademySoftwareFoundation:master Jan 21, 2018
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Jan 21, 2018
…n#1848)

Field3D is supposed to just throw an exception that we can catch if it
can't open the file, but under some circumstances it just plain crashes
when asked to open a file that isn't a f3d file at all.

The reason this comes up is that OIIO's behaveior when the usual reader
can't open a file is to try ALL of them (hoping that maybe the file is
just mis-named) or the hint heuristics are wrong.

I'm not inclined to try to fix the field3d internals myself at this
moment, so for now I'm just making the OIIO field3d reader fail if the
file is not named ".f3d". This violates our intended rule of "it doesn't
matter what the file is called", but I can only rely on that if the
underlying format library is rock solid when presented a file of the
wrong type.
@lgritz lgritz deleted the lg-f3d branch January 21, 2018 02:53
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