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

FILE* in opj API is unsafe #120

Closed
gcode-importer opened this issue Feb 16, 2012 · 6 comments
Closed

FILE* in opj API is unsafe #120

gcode-importer opened this issue Feb 16, 2012 · 6 comments

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 120

Due to large file support implementation,
it is unsafe to have FILE* in openjpeg.h


The library is now compiled with LFS when it is available (it will be hard to find
a system without this support).
This involves activating some flags in the hidden opj_config.h, which modify the behaviour
of system header.

From the application point of view, if the application code is not compiled with LFS,
then fopen returns a FILE* which is incompatible with the internal fseek/ftell used
inside openjpeg library.

Forcing application code to be compiled with LFS is probably not an option.
Too risky...


3 public functions are incriminated :
opj_stream_create_default_file_stream (FILE * p_file, opj_bool p_is_read_stream)
opj_stream_create_file_stream (FILE * p_file, OPJ_UINT32 p_buffer_size, opj_bool p_is_read_stream)
opj_dump_codec( opj_codec_t *p_codec,OPJ_INT32 info_flag,FILE* output_stream)

They should take "const char*" and do the fopen/fclose internally.





Reported by julienmalik on 2012-02-16 11:02:55

@gcode-importer
Copy link
Author

Reported by detonin on 2012-02-20 16:04:00

@gcode-importer
Copy link
Author

Reported by detonin on 2012-02-20 16:18:20

  • Labels added: Milestone-Release2.0

@gcode-importer
Copy link
Author

See also #198

Reported by julienmalik on 2012-11-30 11:46:54

@gcode-importer
Copy link
Author

Reported by malaterre on 2014-02-24 09:04:28

@gcode-importer
Copy link
Author

closing issue 120, please follow issue 198 instead. thanks

Reported by malaterre on 2014-02-25 15:28:55

  • Status changed: WontFix

@gcode-importer
Copy link
Author

Reported by malaterre on 2014-02-27 17:11:56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants