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

jas_stream_close closes a file object it didn't open #286

Closed
giraffedata opened this issue Mar 21, 2021 · 3 comments
Closed

jas_stream_close closes a file object it didn't open #286

giraffedata opened this issue Mar 21, 2021 · 3 comments

Comments

@giraffedata
Copy link

When I open a stream from an existing open file with jas_stream_fdopen(), then when I close that stream with jas_stream_close(), it should leave that file open.

In older libjasper, there was code in jas_stream_fdopen() to set the flag JAS_STREAM_NOCLOSE and code in jas_stream_close() to forego closing if that flag was set.

Current libjasper sets flag JAS_STREAM_FILEOBJ_NOCLOSE, but jas_stream_close() pays no attention to it and in practice, the file gets closed. I see no place that JAS_STREAM_FILEOBJ_NOCLOSE .

@mdadams
Copy link
Collaborator

mdadams commented Mar 21, 2021

@giraffedata Just out of curiosity, in which version of JasPer did this previously work? It seems to have been broken for a while. In any case, I have added a check for this flag to the code. Please confirm that it now works for you. The fix is in commit 66f3d9d.

@giraffedata
Copy link
Author

giraffedata commented Mar 21, 2021 via email

@mdadams
Copy link
Collaborator

mdadams commented Mar 21, 2021

@giraffedata Thanks for the clarification. The 1.600.0 version is very old. In any case, the problem should be fixed now, I think.

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

No branches or pull requests

2 participants